/* ═══════════════════════════════════════════════════
   D&D NPC Generator — style.css (FULL REPLACE)
   Mobile-safe + theme-proof version
   ═══════════════════════════════════════════════════ */

/* ── Base wrapper ── */
.dnd-npc-wrap {
    font-family: Georgia, "Times New Roman", serif;
    max-width: 860px;
    margin: 0 auto;
    padding: 0 16px 40px;
    color: #2c1a0e;
    box-sizing: border-box;
}

/* ── Header ── */
.dnd-npc-header {
    text-align: center;
    padding: 32px 0 24px;
}

.dnd-npc-title {
    font-size: 2.2rem;
    font-weight: 700;
    color: #2C5D7A;
    margin: 0 0 6px;
    text-shadow: 1px 1px 0 #f0dab0;
}

.dnd-npc-subtitle {
    font-size: 1rem;
    color: #7a5c3a;
    font-style: italic;
    margin: 0;
}

/* ── Controls ── */
.dnd-npc-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 24px;
}

.dnd-npc-gender-toggle {
    display: flex;
    gap: 12px;
    padding: 8px 14px;
    background: #f7eed8;
    border: 1px solid #0295EA;
    border-radius: 8px;
}

.dnd-npc-toggle-label {
    font-size: 0.9rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
}

/* ── Buttons ── */
.dnd-npc-btn {
    background: #2C5D7A;
    color: #f5e6c8;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
    transition: 0.2s;
}

.dnd-npc-btn:hover {
    background: #9e2b2b;
    transform: translateY(-2px);
}

.dnd-npc-btn-secondary {
    background: #5c3d1e;
}

.dnd-npc-btn-ghost {
    background: transparent;
    border: 2px solid #0295EA;
    color: #5c3d1e;
}

/* ── Card ── */
.dnd-npc-card {
    background: #fdf6e3;
    border: 2px solid #0295EA;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.12);
    position: relative;
}

.dnd-npc-hidden {
    display: none;
}

/* ── Name ── */
.dnd-npc-name {
    font-size: 1.8rem;
    font-weight: bold;
    color: #2C5D7A;
    text-align: center;
}

.dnd-npc-meta {
    text-align: center;
    font-style: italic;
    color: #7a5c3a;
}

/* ── GRID (FORCE SAFE LAYOUT) ── */
.dnd-npc-grid {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 14px !important;
    width: 100%;
    box-sizing: border-box;
}

/* ── Sections ── */
.dnd-npc-section {
    background: rgba(255,255,255,0.6);
    border: 1px solid rgba(201,169,110,0.45);
    border-radius: 8px;
    padding: 12px;
    min-width: 0;
    box-sizing: border-box;
}

.dnd-npc-section h3 {
    margin: 0 0 10px;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #2C5D7A;
}

/* Secret spans full width */
.dnd-npc-section:last-child {
    grid-column: 1 / -1;
}

/* ── Definition list ── */
dl {
    margin: 0;
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 4px 10px;
}

dt {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: #9a7045;
}

dd {
    margin: 0;
    font-size: 0.92rem;
}

/* ── Buttons row ── */
.dnd-npc-reroll-wrap {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 20px;
}

/* ── MOBILE FIX (IMPORTANT) ── */
@media (max-width: 768px) {
    .dnd-npc-grid {
        grid-template-columns: 1fr !important;
    }

    .dnd-npc-controls {
        flex-direction: column;
    }

    .dnd-npc-title {
        font-size: 1.5rem;
    }
}
