/* =========================================
   VARIÁVEIS DE TEMA
========================================= */
:root {
    --accent-color: #8b0000;
    --accent-hover: #ff3333;
    --accent-shadow: rgba(139, 0, 0, 0.2);
    --accent-glow: rgba(139, 0, 0, 0.5);
}

/* =========================================
   ESTRUTURA GERAL
========================================= */
body {
    background-color: #000000;
    color: #ffffff;
    font-family: 'Courier New', Courier, monospace;
    margin: 0;
    padding: 20px;
    padding-bottom: 90px;
}

.ficha-container {
    max-width: 800px;
    margin: 0 auto;
    background-color: #0a0a0a;
    border: 2px solid var(--accent-color);
    padding: 30px;
    box-shadow: 0 0 25px var(--accent-shadow);
}

/* =========================================
   TÍTULOS E SEÇÕES (CORE)
========================================= */
h1 {
    color: var(--accent-color);
    text-align: center;
    letter-spacing: 2px;
    border-bottom: 2px solid var(--accent-color);
    padding-bottom: 15px;
    margin-top: 0;
}

h2 {
    font-size: 1.1rem;
    color: var(--accent-color);
    margin-top: 30px;
    border-bottom: 1px dashed var(--accent-color);
    padding-bottom: 5px;
}

.attr-titulo {
    font-size: 0.9rem;
    color: var(--accent-color);
    margin-bottom: 8px;
    border-bottom: 1px solid var(--accent-color);
    text-align: center;
}

/* =========================================
   TEXTOS, LABELS E LISTAS
========================================= */
label {
    font-weight: bold;
    display: block;
    margin-bottom: 5px;
    color: #ffffff;
}

.proficiencia-label {
    color: var(--accent-color);
}

ul {
    list-style-type: none;
    padding: 0;
}

li {
    padding: 10px 0;
    border-bottom: 1px solid #222;
    font-size: 1.1rem;
    color: #ffffff;
}

small {
    color: #aaaaaa;
    margin-left: 10px;
}

/* Números gerados pelo sistema */
span[id^="val-"], .modificador, strong {
    font-weight: bold;
    color: #ffffff;
}

.modificador {
    display: block;
    font-size: 1.5rem;
    margin-top: 10px;
}

/* =========================================
   CAIXAS DE ENTRADA (INPUTS E TEXTAREAS)
========================================= */
input[type="text"], input[type="number"], textarea {
    background-color: #1a1a1a;
    color: #ffffff;
    border: 1px solid var(--accent-color);
    padding: 8px;
    width: 90%;
    font-family: inherit;
    box-sizing: border-box;
}

textarea {
    width: 100%;
    resize: vertical;
    margin-top: 5px;
}

input:focus, textarea:focus {
    outline: none;
    border-color: var(--accent-hover);
    background-color: #222222;
}

input[type="checkbox"] {
    accent-color: var(--accent-color);
    transform: scale(1.2);
    margin-right: 8px;
}

/* =========================================
   GRIDS (ORGANIZAÇÃO DE COLUNAS)
========================================= */
.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.grid-atributos {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-bottom: 20px;
}

@media (max-width: 768px) {
    body {
        padding: 12px;
        padding-bottom: 110px;
    }

    .ficha-container {
        padding: 20px;
        margin: 0 auto;
        width: auto;
        max-width: 100%;
        box-sizing: border-box;
    }

    .grid-2,
    .grid-atributos,
    .grid-pericias {
        grid-template-columns: 1fr;
    }

    .grid-pericias {
        padding: 12px;
        box-sizing: border-box;
        overflow: hidden;
    }

    .grid-pericias label {
        word-break: break-word;
        overflow-wrap: anywhere;
    }

    .controles-arquivo {
        flex-direction: column;
        align-items: stretch;
    }

    .controles-arquivo button,
    .controles-arquivo .btn-importar {
        width: 100%;
        text-align: center;
    }

    .theme-switcher {
        left: 12px;
        bottom: 12px;
    }
}

@media (max-width: 480px) {
    h1 {
        font-size: 1.4rem;
        letter-spacing: 1px;
    }

    h2 {
        font-size: 1rem;
    }

    .ficha-container {
        padding: 16px;
        margin: 0 auto;
    }

    input[type="text"], input[type="number"], textarea {
        width: 100%;
    }

    .grid-pericias label {
        font-size: 0.95rem;
    }

    .atributo-box input {
        width: 100%;
        max-width: 90px;
    }
}

.atributo-box {
    background-color: #111111;
    padding: 15px;
    text-align: center;
    border: 1px solid var(--accent-color);
    border-radius: 4px;
}

.atributo-box label {
    color: var(--accent-color);
}

.atributo-box input {
    width: 60px;
    text-align: center;
    font-size: 1.2rem;
    margin-top: 10px;
}

.grid-pericias {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    background-color: #111111;
    padding: 15px;
    border: 1px solid var(--accent-color);
    border-radius: 4px;
}

/* =========================================
   BOTÕES DE EXPORTAR / IMPORTAR
========================================= */
.controles-arquivo {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 20px;
}

button, .btn-importar {
    background-color: #1a1a1a;
    color: #ffffff;
    border: 1px solid var(--accent-color);
    padding: 10px 15px;
    cursor: pointer;
    font-family: inherit;
    font-weight: bold;
    border-radius: 4px;
    transition: 0.2s;
}

button:hover, .btn-importar:hover {
    background-color: var(--accent-color);
    color: #fff;
}

/* Esconde o input file feio original */
#arquivo-import {
    display: none;
}

/* =========================================
   ÍCONES VETORIAIS (SVG)
========================================= */
.icon-svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
    vertical-align: middle;
    margin-right: 8px;
    margin-bottom: 2px;
}

/* =========================================
   POP-UP CUSTOMIZADO (TOAST NOTIFICATION)
========================================= */
.toast {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background-color: #111111;
    color: #ffffff;
    border-left: 5px solid var(--accent-color);
    padding: 15px 25px;
    box-shadow: 0 0 20px var(--accent-glow);
    font-family: inherit;
    font-weight: bold;
    border-radius: 4px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s ease-in-out;
    z-index: 1000;
}

.toast.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* =========================================
   SELETOR DE CORES
========================================= */
.theme-switcher {
    position: fixed;
    left: 20px;
    bottom: 20px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
}

.theme-toggle {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background-color: #111111;
    color: #ffffff;
    border: 1px solid var(--accent-color);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 15px var(--accent-shadow);
    cursor: pointer;
    transition: 0.2s ease;
}

.theme-toggle:hover {
    background-color: var(--accent-color);
    transform: translateY(-2px);
}

.theme-panel {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 10px;
    background-color: #111111;
    border: 1px solid var(--accent-color);
    border-radius: 8px;
    box-shadow: 0 0 15px var(--accent-shadow);
    opacity: 0;
    visibility: hidden;
    transform: translateY(6px);
    transition: all 0.2s ease;
}

.theme-switcher.open .theme-panel {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.theme-option {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 2px solid #ffffff;
    cursor: pointer;
    padding: 0;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.theme-option:hover {
    transform: scale(1.08);
}

.theme-option.active {
    box-shadow: 0 0 0 2px #111111, 0 0 0 4px var(--accent-color);
}

.theme-option[data-theme="vermelho"] { background-color: #8b0000; }
.theme-option[data-theme="verde"] { background-color: #0f6b2f; }
.theme-option[data-theme="azul"] { background-color: #0d4f8b; }
.theme-option[data-theme="ciano"] { background-color: #0b7a7a; }
.theme-option[data-theme="amarelo"] { background-color: #8f7a00; }
.theme-option[data-theme="roxo"] { background-color: #5b2a86; }