/* ========================================================================== 
   NightVenture Legacy — Dev Build Page
   Tableau de bord auth / sauvegarde / debug pour le moteur web maison.
   ========================================================================== */

.nv-dev-build-card {
    width: min(1040px, 100%);
    padding: clamp(18px, 3vw, 28px);
    text-align: left;
    background:
        radial-gradient(circle at top left, rgba(245, 211, 122, 0.14), transparent 34%),
        linear-gradient(180deg, rgba(22, 18, 32, 0.96), rgba(11, 12, 18, 0.96));
    border: 1px solid rgba(245, 211, 122, 0.26);
    border-radius: 20px;
    box-shadow: 0 22px 70px rgba(0, 0, 0, 0.48);
}

.nv-dev-build-card--main {
    margin: 0 auto;
}

.nv-dev-build-header {
    display: grid;
    gap: 8px;
    margin-bottom: 18px;
}

.nv-dev-build-header h1,
.nv-dev-build-header h2 {
    margin: 0;
    line-height: 1.08;
}

.nv-dev-build-header p {
    max-width: 760px;
    margin: 0;
    color: var(--text-muted, #b9ad94);
    line-height: 1.5;
}

.nv-dev-build-kicker {
    color: var(--gold-bright, #ffd66b);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

.nv-dev-build-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 14px;
    margin-top: 16px;
}

.nv-dev-build-panel {
    min-width: 0;
    padding: 14px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.045);
}

.nv-dev-build-panel h3 {
    margin: 0 0 12px;
    color: var(--gold-bright, #ffd66b);
    font-size: 1rem;
}

.nv-dev-build-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 12px 0 4px;
}

.nv-dev-build-actions button,
.nv-dev-build-actions label {
    flex: 1 1 180px;
    min-height: 42px;
}

.nv-dev-save-actions {
    display: grid;
    gap: 10px;
    margin-top: 12px;
}

.nv-dev-save-choice {
    display: grid;
    grid-template-columns: minmax(160px, 0.78fr) minmax(160px, 1.22fr);
    gap: 10px;
    align-items: center;
}

.nv-dev-save-choice button {
    min-height: 42px;
}

.nv-dev-save-meta {
    min-height: 42px;
    display: flex;
    align-items: center;
    padding: 9px 11px;
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.18);
    color: var(--text-muted, #b9ad94);
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
    font-size: 0.82rem;
    line-height: 1.25;
    overflow-wrap: anywhere;
}

.nv-dev-save-meta[data-state="ok"] {
    color: var(--success, #63e37b);
    border-color: rgba(99, 227, 123, 0.26);
}

.nv-dev-save-meta[data-state="error"] {
    color: var(--danger, #ff7777);
    border-color: rgba(255, 119, 119, 0.26);
}

.nv-dev-build-list {
    display: grid;
    gap: 8px;
}

.nv-dev-build-row {
    display: grid;
    grid-template-columns: minmax(105px, 0.78fr) minmax(0, 1.22fr);
    gap: 10px;
    align-items: baseline;
    padding: 8px 10px;
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.2);
}

.nv-dev-build-label {
    color: var(--text-muted, #b9ad94);
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.nv-dev-build-value {
    min-width: 0;
    overflow-wrap: anywhere;
    color: var(--text, #efe4ca);
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
    font-size: 0.88rem;
    line-height: 1.35;
}

.nv-dev-build-value[data-state="ok"] {
    color: var(--success, #63e37b);
}

.nv-dev-build-value[data-state="error"] {
    color: var(--danger, #ff7777);
}

.nv-dev-build-status {
    min-height: 1.4em;
    margin-top: 12px;
    padding: 9px 11px;
    border: 1px solid rgba(245, 211, 122, 0.18);
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.22);
    color: var(--text-muted, #b9ad94);
    line-height: 1.35;
}

.nv-dev-build-status[data-type="success"] {
    color: var(--success, #63e37b);
    border-color: rgba(99, 227, 123, 0.35);
}

.nv-dev-build-status[data-type="error"] {
    color: var(--danger, #ff7777);
    border-color: rgba(255, 119, 119, 0.35);
}

.nv-dev-build-danger {
    border-color: rgba(255, 119, 119, 0.45) !important;
}

.nv-dev-build-advanced {
    margin-top: 14px;
    padding: 12px 14px;
    border: 1px solid rgba(245, 211, 122, 0.16);
    border-radius: 14px;
    background: rgba(0, 0, 0, 0.16);
}

.nv-dev-build-advanced summary {
    cursor: pointer;
    color: var(--gold-bright, #ffd66b);
    font-weight: 800;
}

.nv-dev-build-advanced p {
    margin: 10px 0 0;
    color: var(--text-muted, #b9ad94);
    line-height: 1.45;
}

.nv-dev-json-modal {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: grid;
    place-items: center;
    padding: 18px;
    background: rgba(0, 0, 0, 0.72);
    backdrop-filter: blur(4px);
}

.nv-dev-json-card {
    width: min(960px, 100%);
    max-height: min(88vh, 820px);
    display: grid;
    grid-template-rows: auto minmax(260px, 1fr) auto;
    gap: 12px;
    padding: 18px;
    border: 1px solid rgba(245, 211, 122, 0.26);
    border-radius: 16px;
    background: linear-gradient(180deg, rgba(30, 24, 42, 0.98), rgba(10, 12, 20, 0.98));
    box-shadow: 0 20px 70px rgba(0, 0, 0, 0.52);
}

.nv-dev-json-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.nv-dev-json-header h3 {
    margin: 0;
}

.nv-dev-json-header button {
    min-width: 42px;
}

.nv-dev-json-textarea {
    width: 100%;
    min-height: 300px;
    resize: vertical;
    padding: 12px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.42);
    color: var(--text, #efe4ca);
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
    font-size: 0.84rem;
    line-height: 1.45;
}

#login-screen .nv-dev-build-card {
    max-height: min(92vh, 920px);
    overflow: auto;
}

@media (max-width: 700px) {
    .nv-dev-build-card {
        padding: 16px;
        border-radius: 16px;
    }

    .nv-dev-build-grid {
        grid-template-columns: 1fr;
    }

    .nv-dev-build-row,
    .nv-dev-save-choice {
        grid-template-columns: 1fr;
        gap: 4px;
    }

    .nv-dev-build-actions button,
    .nv-dev-build-actions label {
        flex-basis: 100%;
    }
}
