/* PIRATE BORG Character Generator - Dark & Grimy Aesthetic */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Courier New', Courier, monospace;
    background-color: #0a0a0a;
    color: #e0d5c7;
    line-height: 1.6;
    padding: 20px;
}

.container {
    max-width: 900px;
    margin: 0 auto;
}

/* Header */
.header {
    text-align: center;
    padding: 30px 20px;
    background: linear-gradient(180deg, #1a0000 0%, #000000 100%);
    border: 3px solid #8b0000;
    margin-bottom: 30px;
    box-shadow: 0 4px 20px rgba(139, 0, 0, 0.5);
}

.header h1 {
    font-size: 3em;
    color: #ff6b6b;
    text-shadow: 3px 3px 0px #000000, 0 0 20px #8b0000;
    letter-spacing: 8px;
    margin-bottom: 10px;
}

.header h2 {
    font-size: 1.5em;
    color: #d4af37;
    text-transform: uppercase;
    letter-spacing: 4px;
}

.btn-generate {
    margin-top: 20px;
    margin-right: 10px;
    padding: 15px 40px;
    font-size: 1.2em;
    font-weight: bold;
    background-color: #8b0000;
    color: #fff;
    border: 3px solid #ff6b6b;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 2px;
    transition: all 0.3s ease;
    font-family: 'Courier New', Courier, monospace;
}

.btn-generate:hover {
    background-color: #ff6b6b;
    border-color: #d4af37;
    box-shadow: 0 0 20px #ff6b6b;
    transform: scale(1.05);
}

.header .btn-print {
    margin-top: 20px;
    padding: 15px 40px;
    font-size: 1.2em;
    font-weight: bold;
}

.button-row {
    margin-top: 20px;
}

.house-rules {
    margin-top: 20px;
    padding: 15px;
    background: #000;
    border: 2px solid #d4af37;
}

.checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    color: #e0d5c7;
    font-size: 1em;
}

.checkbox-label input[type="checkbox"] {
    width: 20px;
    height: 20px;
    margin-right: 10px;
    cursor: pointer;
    accent-color: #d4af37;
}

.checkbox-label span {
    user-select: none;
}

.lottie-animation {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 20px 0;
}

.lottie-animation lottie-player {
    filter: drop-shadow(0 0 10px rgba(212, 175, 55, 0.3));
}

/* Character Sheet */
.character-sheet {
    background: linear-gradient(135deg, #1a1a1a 0%, #0d0d0d 100%);
    border: 4px double #8b0000;
    padding: 30px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.8), inset 0 0 50px rgba(139, 0, 0, 0.1);
}

/* Character Header */
.character-header {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 3px solid #8b0000;
}

.name-section, .class-section {
    text-align: center;
}

.character-header label {
    display: block;
    font-size: 0.9em;
    color: #d4af37;
    text-transform: uppercase;
    letter-spacing: 3px;
    margin-bottom: 10px;
    font-weight: bold;
}

.character-header h3 {
    font-size: 2em;
    color: #ff6b6b;
    text-shadow: 2px 2px 0px #000;
    text-transform: uppercase;
}

/* Abilities */
.abilities {
    margin-bottom: 25px;
}

.abilities h4 {
    font-size: 1.3em;
    color: #d4af37;
    text-transform: uppercase;
    letter-spacing: 3px;
    margin-bottom: 15px;
    text-align: center;
    border-bottom: 2px solid #d4af37;
    padding-bottom: 10px;
}

.ability-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 15px;
}

.ability {
    background: #000000;
    border: 2px solid #8b0000;
    padding: 15px;
    text-align: center;
}

.ability-name {
    display: block;
    font-size: 0.85em;
    color: #d4af37;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
}

.ability-score {
    display: block;
    font-size: 2em;
    color: #ff6b6b;
    font-weight: bold;
}

/* Stats */
.stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-bottom: 25px;
}

.stat-box {
    background: #000000;
    border: 2px solid #d4af37;
    padding: 20px;
    text-align: center;
}

.stat-box label {
    display: block;
    font-size: 0.9em;
    color: #d4af37;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 10px;
}

.stat-value {
    font-size: 2.5em;
    color: #ff6b6b;
    font-weight: bold;
}

/* Sections */
section {
    margin-bottom: 25px;
}

section h4 {
    font-size: 1.2em;
    color: #d4af37;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 12px;
    border-bottom: 2px solid #8b0000;
    padding-bottom: 8px;
}

section p {
    background: #000000;
    border-left: 4px solid #8b0000;
    padding: 15px;
    margin: 10px 0;
    color: #e0d5c7;
}

/* Equipment Grid */
.equipment-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-bottom: 15px;
}

.equipment-item {
    background: #000000;
    border: 2px solid #8b0000;
    padding: 15px;
    text-align: center;
}

.equipment-item label {
    display: block;
    font-size: 0.85em;
    color: #d4af37;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
    font-weight: bold;
}

.equipment-item p {
    font-size: 0.95em;
    color: #e0d5c7;
    margin: 0;
    padding: 0;
    background: none;
    border: none;
}

/* Class Abilities */
.class-abilities div {
    background: #000000;
    border: 2px solid #d4af37;
    padding: 15px;
    color: #e0d5c7;
}

/* Idiosyncrasies */
.idiosyncrasies {
    margin-bottom: 25px;
}

.idiosyncrasies h4 {
    font-size: 1.2em;
    color: #ff6b6b;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 12px;
    border-bottom: 2px solid #8b0000;
    padding-bottom: 8px;
    text-align: center;
}

.idiosyncrasies p {
    background: #000000;
    border-left: 4px solid #ff6b6b;
    padding: 15px;
    margin: 10px 0;
    color: #e0d5c7;
}

/* Unfortunate Incidents & Conditions */
.unfortunate-incidents {
    margin-bottom: 25px;
}

.unfortunate-incidents h4 {
    font-size: 1.2em;
    color: #ff6b6b;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 12px;
    border-bottom: 2px solid #8b0000;
    padding-bottom: 8px;
    text-align: center;
}

.unfortunate-incidents p {
    background: #000000;
    border-left: 4px solid #8b0000;
    padding: 15px;
    margin: 10px 0;
    color: #e0d5c7;
}

/* Footer */
.footer {
    text-align: center;
    margin-top: 40px;
    padding: 30px;
    background: #000000;
    border: 2px solid #8b0000;
    color: #666;
}

.footer p {
    margin: 8px 0;
    background: none;
    border: none;
    padding: 0;
}

.btn-print {
    margin-top: 20px;
    padding: 12px 30px;
    font-size: 1em;
    background-color: #1a1a1a;
    color: #d4af37;
    border: 2px solid #d4af37;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 2px;
    transition: all 0.3s ease;
    font-family: 'Courier New', Courier, monospace;
}

.btn-print:hover {
    background-color: #d4af37;
    color: #000;
    box-shadow: 0 0 15px #d4af37;
}

/* Print Styles - Optimized for Single Page */
@media print {
    * {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    body {
        background-color: white;
        color: black;
        padding: 0;
        margin: 0;
        font-size: 9pt;
        line-height: 1.2;
    }

    .no-print {
        display: none !important;
    }

    .container {
        max-width: 100%;
        margin: 0;
        padding: 5px;
    }

    .character-sheet {
        background: white;
        border: 1px solid black;
        box-shadow: none;
        page-break-inside: avoid;
        padding: 8px;
    }

    /* Compact header */
    .character-header {
        margin-bottom: 6px;
        padding-bottom: 4px;
        border-bottom: 2px solid black;
    }

    .character-header label {
        font-size: 7pt;
        margin-bottom: 2px;
    }

    .character-header h3 {
        color: black;
        text-shadow: none;
        font-size: 14pt;
        margin: 0;
    }

    /* Compact sections */
    section {
        margin-bottom: 6px;
        page-break-inside: avoid;
    }

    section h4 {
        font-size: 9pt;
        color: black;
        border-color: black;
        margin-bottom: 4px;
        padding-bottom: 2px;
    }

    section p {
        background: white;
        border-color: black;
        padding: 4px;
        margin: 2px 0;
        font-size: 8pt;
        line-height: 1.1;
    }

    /* Compact abilities grid */
    .abilities {
        margin-bottom: 6px;
    }

    .ability-grid {
        gap: 4px;
    }

    .ability {
        background: white;
        border: 1px solid black;
        padding: 4px;
    }

    .ability-name {
        font-size: 7pt;
        margin-bottom: 2px;
    }

    .ability-score {
        color: black;
        font-size: 14pt;
    }

    /* Compact stats */
    .stats {
        gap: 4px;
        margin-bottom: 6px;
    }

    .stat-box {
        background: white;
        border: 1px solid black;
        padding: 6px;
    }

    .stat-box label {
        font-size: 7pt;
        margin-bottom: 2px;
    }

    .stat-value {
        color: black;
        font-size: 16pt;
    }

    /* Compact equipment grid */
    .equipment-grid {
        gap: 4px;
        margin-bottom: 4px;
    }

    .equipment-item {
        background: white;
        border: 1px solid black;
        padding: 4px;
    }

    .equipment-item label {
        font-size: 7pt;
        margin-bottom: 2px;
    }

    .equipment-item p {
        font-size: 7pt;
        padding: 2px 0;
    }

    /* Compact class abilities */
    .class-abilities div,
    .idiosyncrasies p,
    .unfortunate-incidents p {
        background: white;
        border: 1px solid black;
        padding: 4px;
        font-size: 7pt;
        line-height: 1.1;
    }

    /* Hide emojis in print for cleaner look */
    .idiosyncrasies h4::before,
    .idiosyncrasies h4::after,
    .unfortunate-incidents h4::before,
    .unfortunate-incidents h4::after {
        content: '' !important;
    }

    /* Remove emoji from headers */
    section h4 {
        font-size: 8pt;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .ability-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .stats {
        grid-template-columns: 1fr;
    }

    .equipment-grid {
        grid-template-columns: 1fr;
    }

    .character-header {
        grid-template-columns: 1fr;
    }

    .header h1 {
        font-size: 2em;
        letter-spacing: 4px;
    }

    .header h2 {
        font-size: 1.2em;
    }
}
