@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
}

body {
    font-family: 'Press Start 2P', monospace;
    background: #0f380f;
    background-image: 
        repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(0, 0, 0, 0.1) 2px, rgba(0, 0, 0, 0.1) 4px);
    min-height: 100vh;
    padding: 20px;
    position: relative;
    overflow-x: hidden;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(0, 0, 0, 0.15) 2px, rgba(0, 0, 0, 0.15) 4px);
    pointer-events: none;
    z-index: 9999;
}

.creation-container {
    background: #306230;
    border: 8px solid #0f380f;
    box-shadow: 
        0 0 0 4px #9bbc0f,
        inset 0 0 0 4px #0f380f,
        8px 8px 0 0 rgba(0, 0, 0, 0.3);
    max-width: 900px;
    width: 100%;
    padding: 30px;
    position: relative;
    margin: 0 auto;
}
.dashboard {
    background: #306230;
    border: 8px solid #0f380f;
    box-shadow: 
        0 0 0 4px #9bbc0f,
        inset 0 0 0 4px #0f380f,
        8px 8px 0 0 rgba(0, 0, 0, 0.3);
    max-width: 900px;
    width: 100%;
    padding: 30px;
    position: relative;
    margin: 0 auto;
}

.game-screen {
    display: none;
}

.game-screen.active {
    display: block;
}

.creation-container::before {
    content: '';
    position: absolute;
    top: -4px;
    left: -4px;
    right: -4px;
    bottom: -4px;
    border: 4px solid #9bbc0f;
    pointer-events: none;
}

.header {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px;
    background: #0f380f;
    border: 4px solid #9bbc0f;
}

.header h1 {
    font-size: 1.5em;
    color: #9bbc0f;
    text-shadow: 
        4px 4px 0 #0f380f,
        -2px -2px 0 #0f380f;
    margin-bottom: 15px;
    letter-spacing: 2px;
}

.header p {
    color: #8bac0f;
    font-size: 0.5em;
    line-height: 1.8;
}

.step-indicator {
    display: flex;
    justify-content: center;
    margin-bottom: 30px;
    gap: 15px;
    flex-wrap: wrap;
}

.step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.step-number {
    width: 40px;
    height: 40px;
    background: #0f380f;
    border: 4px solid #306230;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: #8bac0f;
    font-size: 0.8em;
    position: relative;
}

.step.active .step-number {
    background: #8bac0f;
    border-color: #9bbc0f;
    color: #0f380f;
    animation: blink 1s infinite;
}

@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0.7; }
}

.step.completed .step-number {
    background: #9bbc0f;
    border-color: #0f380f;
    color: #0f380f;
}

.step.completed .step-number::after {
    content: '✓';
    position: absolute;
}

.step-label {
    color: #8bac0f;
    font-size: 0.4em;
    text-transform: uppercase;
}

.step.active .step-label {
    color: #9bbc0f;
}

.creation-step {
    display: none;
}

.creation-step.active {
    display: block;
    animation: slideDown 0.3s steps(10);
}

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

.form-group {
    margin-bottom: 25px;
}

label {
    display: block;
    margin-bottom: 10px;
    color: #9bbc0f;
    font-size: 0.6em;
    text-transform: uppercase;
    text-shadow: 2px 2px 0 #0f380f;
}

input[type="text"] {
    width: 100%;
    padding: 12px;
    background: #0f380f;
    border: 4px solid #306230;
    border-radius: 0;
    font-family: 'Press Start 2P', monospace;
    font-size: 0.6em;
    color: #9bbc0f;
}

input[type="text"]:focus {
    outline: none;
    border-color: #9bbc0f;
    box-shadow: inset 0 0 0 2px #8bac0f;
}

.class-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 15px;
    margin-top: 15px;
}

.class-card {
    background: #0f380f;
    border: 4px solid #306230;
    padding: 15px;
    cursor: pointer;
    transition: all 0.1s steps(5);
    position: relative;
}

.class-card:hover {
    border-color: #8bac0f;
    transform: translate(-2px, -2px);
    box-shadow: 4px 4px 0 #0f380f;
}

.class-card.selected {
    border-color: #9bbc0f;
    background: #1a5c1a;
    box-shadow: 
        inset 0 0 0 2px #8bac0f,
        4px 4px 0 #0f380f;
}

.class-card.selected::before {
    content: '▶';
    position: absolute;
    left: 5px;
    top: 5px;
    color: #9bbc0f;
    animation: blink 1s infinite;
}

.class-content {
    position: relative;
}

.class-icon {
    font-size: 3em;
    text-align: center;
    margin-bottom: 10px;
    filter: contrast(2) brightness(1.2);
}

.class-name {
    font-size: 0.7em;
    color: #9bbc0f;
    text-align: center;
    margin-bottom: 10px;
    text-transform: uppercase;
}

.class-description {
    color: #8bac0f;
    font-size: 0.4em;
    text-align: center;
    margin-bottom: 10px;
    line-height: 1.6;
}

.class-stats {
    background: #306230;
    border: 2px solid #0f380f;
    padding: 8px;
    font-size: 0.5em;
}

.stat-row {
    display: flex;
    justify-content: space-between;
    margin: 6px 0;
    color: #9bbc0f;
}

.stat-label {
    color: #8bac0f;
}

.stat-value {
    color: #9bbc0f;
    font-weight: bold;
}

.appearance-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-top: 15px;
}

.appearance-section h3 {
    color: #9bbc0f;
    margin-bottom: 12px;
    font-size: 0.6em;
    text-transform: uppercase;
}

.option-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
    gap: 8px;
}

.option-button {
    aspect-ratio: 1;
    border: 4px solid #306230;
    background: #0f380f;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: all 0.1s steps(3);
    padding: 8px;
}

.option-button:hover {
    border-color: #8bac0f;
    transform: scale(1.05);
}

.option-button.selected {
    border-color: #9bbc0f;
    background: #1a5c1a;
    box-shadow: inset 0 0 0 2px #8bac0f;
}

.option-icon {
    font-size: 1.8em;
    margin-bottom: 4px;
}

.option-label {
    font-size: 0.35em;
    text-align: center;
    color: #8bac0f;
    line-height: 1.4;
}

.option-button.selected .option-label {
    color: #9bbc0f;
}

.color-picker {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.color-option {
    width: 40px;
    height: 40px;
    cursor: pointer;
    border: 4px solid #306230;
    transition: all 0.1s steps(3);
}

.color-option:hover {
    transform: scale(1.1);
    border-color: #8bac0f;
}

.color-option.selected {
    border-color: #9bbc0f;
    box-shadow: 0 0 0 2px #0f380f, 0 0 0 6px #9bbc0f;
}

.character-preview {
    background: #0f380f;
    border: 4px solid #306230;
    padding: 25px;
    text-align: center;
    margin-top: 25px;
}

.preview-avatar {
    width: 120px;
    height: 120px;
    margin: 0 auto 20px;
    background: #306230;
    border: 4px solid #9bbc0f;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 4em;
    box-shadow: 
        inset 0 0 0 2px #0f380f,
        4px 4px 0 rgba(0, 0, 0, 0.3);
}

.preview-info h2 {
    color: #9bbc0f;
    margin-bottom: 10px;
    font-size: 0.8em;
}

.preview-info p {
    color: #8bac0f;
    margin: 8px 0;
    font-size: 0.5em;
}

.preview-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-top: 20px;
}

.preview-stat {
    background: #306230;
    border: 4px solid #0f380f;
    padding: 12px;
}

.preview-stat-value {
    font-size: 1.2em;
    color: #9bbc0f;
    text-shadow: 2px 2px 0 #0f380f;
}

.preview-stat-label {
    font-size: 0.4em;
    color: #8bac0f;
    margin-top: 8px;
    text-transform: uppercase;
}

.button-group {
    display: flex;
    gap: 12px;
    margin-top: 25px;
}

button {
    flex: 1;
    padding: 15px 20px;
    border: 4px solid #0f380f;
    font-family: 'Press Start 2P', monospace;
    font-size: 0.5em;
    cursor: pointer;
    transition: all 0.1s steps(5);
    text-transform: uppercase;
    position: relative;
}

.btn-primary {
    background: #8bac0f;
    color: #0f380f;
    border-color: #0f380f;
}

.btn-primary:hover:not(:disabled) {
    background: #9bbc0f;
    transform: translate(-2px, -2px);
    box-shadow: 4px 4px 0 #0f380f;
}

.btn-primary:active:not(:disabled) {
    transform: translate(0, 0);
    box-shadow: 2px 2px 0 #0f380f;
}

.btn-secondary {
    background: #306230;
    color: #8bac0f;
    border-color: #0f380f;
}

.btn-secondary:hover {
    background: #3a7a3a;
}

button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

@keyframes scanline {
    0% {
        transform: translateY(-100%);
    }
    100% {
        transform: translateY(100vh);
    }
}

.progress-bar {
    width: 100%;
    max-width: 300px; 
    height: 20px;
    background-color: #ff0000; 
    overflow: hidden; 
    margin: 10px 0;
    border: 1px solid #555; 
}

.progress-fill {
    height: 100%;
    width: 100%; 
    border-radius: 10px;
    transition: width 0.5s ease, background-color 0.3s ease; 
}

.hp-bar {
    background: linear-gradient(90deg, #00ff0d, #47a233); 
    position: relative;
    overflow: hidden;
}

.hp-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.3), transparent);
    animation: shine 2s infinite; 
}


@keyframes shine {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.progress-bar::after {
    content: attr(data-value); 
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 12px;
    font-weight: bold;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

::-webkit-scrollbar {
    width: 16px;
}

::-webkit-scrollbar-track {
    background: #0f380f;
    border: 2px solid #306230;
}

::-webkit-scrollbar-thumb {
    background: #8bac0f;
    border: 2px solid #306230;
}

::-webkit-scrollbar-thumb:hover {
    background: #9bbc0f;
}

@media (max-width: 768px) {
    .creation-container {
        padding: 20px;
    }

    .header h1 {
        font-size: 1em;
    }

    .header p {
        font-size: 0.4em;
    }

    .class-grid {
        grid-template-columns: 1fr;
    }

    .appearance-grid {
        grid-template-columns: 1fr;
    }

    .preview-stats {
        grid-template-columns: repeat(2, 1fr);
    }

    .step-label {
        font-size: 0.35em;
    }

    label {
        font-size: 0.5em;
    }

    input[type="text"] {
        font-size: 0.5em;
    }

    button {
        font-size: 0.45em;
        padding: 12px 15px;
    }

    .dashboard {
        padding: 20px;
    }

    .stats-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.enemy-display {
    background: #306230;  /* Fond vert clair */
    border: 4px solid #0f380f;
    padding: 20px;
    margin: 0 0 4px 0;
    min-height: 200px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;  /* Pour positionner l'avatar */
}

.enemy-avatar {
    position: absolute;
    right: 30px;
    top: 30px;
    font-size: 5em;
    filter: drop-shadow(4px 4px 0 #0f380f);
    animation: enemyFloat 2s ease-in-out infinite;
}

.combat-screen {
    display: flex;
    flex-direction: column;
    gap: 0;  /* Pas d'espace entre les zones */
}

@keyframes enemyFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.enemy-info-box {
    background: #0f380f;
    border: 4px solid #8bac0f;
    padding: 12px;
    width: 250px;
    position: relative;
}

.enemy-name {
    font-size: 0.65em;
    color: #9bbc0f;
    text-shadow: 2px 2px 0 #0f380f;
    margin-bottom: 10px;
    text-transform: uppercase;
    text-align: left;  /* Aligné à gauche maintenant */
}

.enemy-level {
    position: absolute;
    top: 12px;
    right: 12px;
    color: #8bac0f;
    font-size: 0.5em;
}
.player-display {
    background: #306230;
    border: 4px solid #0f380f;
    padding: 20px;
    margin: 0 0 4px 0;
    min-height: 150px;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    position: relative;
}

.player-avatar {
    position: absolute;
    left: 30px;
    bottom: 30px;
    font-size: 4em;
    filter: drop-shadow(4px 4px 0 #0f380f);
}

.player-info-box {
    background: #0f380f;
    border: 4px solid #8bac0f;
    padding: 12px;
    width: 280px;
    margin-left: auto;  /* Poussé à droite */
}

.combat-log {
    background: #0f380f;
    border: 4px solid #306230;
    padding: 20px;
    min-height: 120px;
    max-height: 120px;  /* Hauteur fixe */
    overflow-y: auto;
    margin: 0 0 4px 0;
    text-align: left;
    box-shadow: inset 0 0 0 2px #8bac0f;
}

.log-entry {
    animation: logAppear 0.3s steps(5);  /* Animation d'apparition */
}

@keyframes logAppear {
    from {
        opacity: 0;
        transform: translateX(-10px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}
.combat-actions {
    background: #0f380f;
    border: 4px solid #306230;
    padding: 15px;
    display: grid;
    grid-template-columns: 1fr 1fr;  /* 2 colonnes */
    gap: 10px;
}