/* ========================
   RESET & BASE
======================== */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: Arial, sans-serif;
}

body {
    background: #1e1e1e;
    color: #eee;
}

/* ========================
   LAYOUT GLOBAL
======================== */
.app {
    display: flex;
    min-height: 100vh;
}

/* ========================
   SIDEBAR
======================== */
.sidebar {
    width: 220px;
    background: #2a2a2a;
    padding: 20px;
    border-right: 1px solid #333;
}

.sidebar h2 {
    margin-bottom: 20px;
    font-size: 1.2rem;
}

.sidebar ul {
    list-style: none;
}

.sidebar li {
    padding: 10px;
    cursor: pointer;
    border-radius: 4px;
    transition: background 0.2s;
}

.sidebar li:hover {
    background: #3a3a3a;
}

.sidebar li.active {
    background: #444;
}

/* ========================
   MAIN CONTENT
======================== */
.main {
    flex: 1;
    display: flex;
    justify-content: center;
    padding: 30px 20px;
}

.content {
    width: 100%;
    max-width: 900px;
}

/* ========================
   TITRES
======================== */
h1 {
    margin-bottom: 20px;
    font-size: 1.6rem;
}

.release {
	font-size: 0.8em;
}

/* ========================
   FORM HEADER
======================== */

:root {
    --npc-grid-columns: 140px 180px 180px 80px 40px;
}

.npc-form-header {
    display: grid;
    grid-template-columns: var(--npc-grid-columns);
    gap: 10px;
    margin-bottom: 8px;
    font-size: 0.75rem;
    color: #888;
    text-transform: uppercase;
}

.npc-row > *,
.npc-form-header > * {
    min-width: 0;
}

/* ========================
   NPC ROW
======================== */
.npc-row {
    display: grid;
    grid-template-columns: var(--npc-grid-columns);
    gap: 10px;
    align-items: center;
    margin-bottom: 10px;
}

/* ========================
   INPUTS & SELECTS
======================== */
.npc-row select,
.npc-row input {
    width: 100%;
    padding: 6px 8px;
    background: #333;
    border: 1px solid #444;
    border-radius: 4px;
    color: #fff;
    font-size: 0.9rem;
}

.npc-row select:focus,
.npc-row input:focus {
    outline: none;
    border-color: #7FFFD4;
}

/* ========================
   DELETE BUTTON
======================== */
.delete {
    background: transparent;
    border: none;
    color: #ff6b6b;
    cursor: pointer;
}

/* ========================
   ACTIONS
======================== */
.actions {
    margin-top: 20px;
    display: flex;
    gap: 10px;
}

/* ========================
   BUTTONS
======================== */
button {
    padding: 10px 15px;
    cursor: pointer;
    background: #444;
    color: white;
    border: none;
    border-radius: 5px;
}

#add-line {
    background: #7FFFD4;
    color: black;
}

#generate {
    background: #DC143C;
}

/* ========================
   NPC OUTPUT
======================== */
.npc-output {
    margin-top: 20px;
}

/* ========================
   NPC GRID
======================== */
.npc-results {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 16px;
}

/* ========================
   NPC CARD
======================== */
.npc-card {
    background: #2a2a2a;
    border-radius: 8px;
    padding: 16px;
    border: 1px solid #444;

    display: flex;
    flex-direction: column;
    gap: 12px;

    min-width: 0;
}

/* ========================
   CARD HEADER
======================== */
.npc-card-header {
    display: grid;
    gap: 4px;

    border-bottom: 1px solid #555;
    padding-bottom: 8px;
}

.npc-type {
    font-size: 0.8rem;
    text-transform: uppercase;
    opacity: 0.8;
}

.npc-main {
    font-size: 1.1rem;
    font-weight: bold;
}

.npc-sub {
    font-size: 0.9rem;
    opacity: 0.7;
}

/* ========================
   LEVEL 2
======================== */
.npc-section {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.npc-section-title {
    font-size: 0.75rem;
    text-transform: uppercase;
    opacity: 0.6;
}

.npc-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
}

.npc-stat {
    background: #1e1e1e;
    padding: 6px;
    border-radius: 4px;
    text-align: center;
}

/* ========================
   LEVEL 3
======================== */
.npc-meta {
    font-size: 0.8rem;
    opacity: 0.75;
    border-top: 1px solid #444;
    padding-top: 6px;
}

/* ========================
   ERROR
======================== */
.error {
    color: #ff6b6b;
    margin-top: 10px;
}

/* ========================
   RESPONSIVE
======================== */
@media (max-width: 768px) {

    .app {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid #333;
    }

    .main {
        padding: 20px 10px;
    }

    /* On masque UNIQUEMENT le header du formulaire */
    .npc-form-header {
        display: none;
    }

    .npc-row {
        grid-template-columns: 1fr;
        background: #2a2a2a;
        padding: 12px;
        border-radius: 6px;
    }

    .actions {
        flex-direction: column;
    }

    button {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .npc-results {
        grid-template-columns: 1fr;
    }
}