/* exportação de fontes seja ela interna ou externa */
@import url('https://fonts.googleapis.com/css2?family=Dancing+Script:wght@400..700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Tagesschrift&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Caveat:wght@400..700&family=Tagesschrift&display=swap');

/* criação de uma paleta de cores utilizando VARIAVEL */
:root {
    --cor0: #2CFF05;
    --cor1: #2B332A;
    --cor2: #52361D;
    --cor3: #ffffff;
    --cor4: rgba(228, 215, 215, 0.13);

    --fonte-padrao:'Tagesschrift', system-ui;
    --fonte-secundaria: 'Dancing Script', cursive;
    --fonte-terciaria: 'Caveat', cursive;
}

/* Reset e estilos gerais */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color:var(--cor4);
    color: var(--cor1);
    line-height: 1.6;
    padding: 150px;
    background-image: url(imagens/fundo/fundolobo17.png);
    background-size: contain; /* Mudado de 'cover' para 'contain' */
    background-position: center top; /* Alinhado ao topo */
    background-repeat: no-repeat;
    background-attachment: fixed;
    min-height: 100vh;
    font-family: Arial, sans-serif;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Container principal */
.main-container {
    width: 100%;
    max-width: 1200px;
    display: flex;
    flex-direction: column;
    align-items: center;
    /* Adiciona um fundo suave para contrastar com a imagem */
    background: var(--cor4);
    border-radius: 15px;
    padding: 10px;
}

/* Topo do site */
.topo-site {
    text-align: center;
    margin-bottom: 10px;
}

.topo-site .logo {
    height: 60px;
    filter: drop-shadow(0 0 5px var(--cor0));
}

/* Imagens flutuantes */
.floating-images {
    width: 100%;
    height: 100px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    padding: 0 20px;
}

.floating-image {
    max-height: 80px;
    max-width: 120px;
    object-fit: contain;
    border: 2px solid var(--cor0);
    border-radius: 8px;
    background-color: var(--cor4);
    display: none;
    box-shadow: 0 0 15px var(--cor0));
    padding: 5px;
}

/* FICHA DO PERSONAGEM */
.character-sheet {
    width: 100%;
    background-color: var(--cor4);
    padding: 25px;
    box-shadow: 0 0 30px var(--cor1);
    border-radius: 15px;
    border: 2px solid var(--cor0);
    margin-bottom: 20px;
    backdrop-filter: blur(5px);
}

.pulse {
    animation: pulse 3s infinite;
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 var(--cor0); }
    70% { box-shadow: 0 0 0 15px var(--cor4); }
    100% { box-shadow: 0 0 0 0 var(--cor0); }
}

/* Título e logo */
.title-container {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 25px;
    gap: 20px;
    flex-wrap: wrap;
}

.title {
    text-align: center;
    color: var(--cor0);
    text-shadow: 2px 2px 4px var(--cor1);
    font-size: 2.8em;
    font-weight: bold;
    letter-spacing: 3px;
    font-family: var(--fonte-padrao);
    margin: 0;
}

.glow {
    text-shadow: 0 0 10px var(--cor0), 0 0 20px var(--cor0);
}

.title-container .logo {
    height: 50px;
    filter: drop-shadow(0 0 5px var(--cor0));
}

/* Seções (sections - quadrados das fichas */
.section {
    margin-bottom: 25px;
    background: linear-gradient(135deg, rgba(11, 165, 57, 0.205) 0%, rgba(18, 102, 3, 0.05) 100%);
    padding: 20px;
    border-radius: 10px;
    border-left: 4px solid var(--cor0);
    border-right: 1px solid var(--cor0);
    border-top: 1px solid var(--cor0);
    border-bottom: 1px solid var(--cor0);
}

.section-title {
    color: var(--cor1);
    border-bottom: 2px solid var(--cor0);
    padding-bottom: 10px;
    margin-bottom: 20px;
    font-size: 1.4em;
    text-shadow: 1px 1px 1px var(--cor0);
    letter-spacing: 1px;
    font-weight: bold;
}

/* Cabeçalho */
.header {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-bottom: 0;
}

.header-item {
    display: flex;
    flex-direction: column;
}

.header-item label {
    font-weight: bold;
    color: var(--cor1);
    margin-bottom: 8px;
    text-shadow: 1px 1px 1px var(--cor0);
    font-size: 14px;
}

.header-item input, 
.header-item select {
    background-color: var(--cor4);
    border: 1px solid var(--cor1);
    color: var(--cor1);
    padding: 10px;
    font-size: 14px;
    border-radius: 5px;
    width: 100%;
    transition: all 0.3s;
}

.header-item input:focus, 
.header-item select:focus {
    outline: none;
    border-color: var(--cor0);
    box-shadow: 0 0 5px var(--cor0);
}

/* Atributos */
.attributes {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.attribute-group {
    margin-bottom: 15px;
}

.attribute-group-title {
    font-weight: bold;
    margin-bottom: 15px;
    color: var(--cor0);
    text-shadow: 1px 1px 1px var(--cor1);
    text-align: center;
    font-size: 16px;
    padding: 8px;
    background: linear-gradient(135deg, var(--cor1) 0%, #1a1f19 100%);
    border-radius: 5px;
    border: 1px solid var(--cor0);
}

.attribute {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding: 8px 5px;
    background: rgba(255,255,255,0.1);
    border-radius: 3px;
}

.attribute-name {
    min-width: 100px;
    color: var(--cor1);
    font-size: 14px;
    font-weight: bold;
}

.dots {
    display: flex;
    gap: 4px;
}

.dot {
    width: 16px;
    height: 16px;
    border: 2px solid var(--cor0);
    border-radius: 50%;
    cursor: pointer;
    background-color: var(--cor1);
    transition: all 0.3s;
}

.dot:hover {
    transform: scale(1.2);
    box-shadow: 0 0 8px var(--cor0);
}

.dot.filled {
    background-color: var(--cor0);
    box-shadow: 0 0 5px var(--cor1);
}

/* Health e Willpower */
.health-willpower-container {
    display: flex;
    justify-content: space-around;
    align-items: center;
    margin-top: 10px;
    padding: 15px;
    background: rgba(43, 51, 42, 0.9);
    border-radius: 8px;
    border: 2px solid var(--cor0);
    flex-wrap: wrap;
    gap: 15px;
}

.health-willpower-item {
    display: flex;
    align-items: center;
    gap: 10px;
}

.health-willpower-item span {
    font-weight: bold;
    color: var(--cor0);
    min-width: 120px;
    text-align: center;
    font-size: 14px;
}

/* Perícias */
.skills {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
}

.skill {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding: 8px 5px;
    background: rgba(255,255,255,0.1);
    border-radius: 3px;
    border-bottom: 1px solid rgba(44, 255, 5, 0.3);
}

.skill-name {
    min-width: 110px;
    color: var(--cor1);
    font-size: 13px;
    font-weight: bold;
}

.skill-input {
    width: 45px;
    background-color: rgba(255, 255, 255, 0.9);
    border: 1px solid var(--cor1);
    color: var(--cor1);
    text-align: center;
    padding: 5px;
    border-radius: 3px;
    font-size: 12px;
    margin: 0 8px;
}

/* Renome */
.renome {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-top: 15px;
}

.renome-item {
    text-align: center;
    background: linear-gradient(135deg, rgba(43, 51, 42, 0.9) 0%, rgba(26, 31, 25, 0.9) 100%);
    padding: 15px;
    border-radius: 8px;
    border: 2px solid var(--cor0);
}

.renome-title {
    font-weight: bold;
    margin-bottom: 10px;
    color: var(--cor0);
    text-shadow: 1px 1px 1px var(--cor1);
    font-size: 16px;
}

.renome .dots {
    justify-content: center;
}

/* Gifts & Rites */
.gifts-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
    background-color: rgba(255, 255, 255, 0.9);
    border-radius: 5px;
    overflow: hidden;
}

.gifts-table th {
    background: linear-gradient(135deg, var(--cor0) 0%, #25e000 100%);
    color: var(--cor1);
    padding: 12px;
    text-align: left;
    font-size: 14px;
    font-weight: bold;
}

.gifts-table td {
    padding: 10px;
    border-bottom: 1px solid var(--cor1);
    background: rgba(255,255,255,0.8);
}

.gifts-table input {
    width: 100%;
    background-color: transparent;
    border: 1px solid var(--cor1);
    color: var(--cor1);
    padding: 8px;
    border-radius: 3px;
    font-size: 13px;
}

.gifts-table input:focus {
    outline: none;
    border-color: var(--cor0);
}

/* Caixa de dados */
.dice-box {
    margin: 20px 0;
    padding: 25px;
    background: rgba(17, 17, 17, 0.95);
    color: #fff;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 0 25px rgba(44, 255, 5, 0.6);
    border: 2px solid var(--cor0);
    width: 100%;
}

.dice-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.dice-control-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.dice-control-group label {
    font-weight: bold;
    color: var(--cor0);
}

.dice-control-group input {
    background: #333;
    color: white;
    border: 1px solid #666;
    padding: 8px;
    border-radius: 5px;
    text-align: center;
    font-size: 16px;
    width: 80px;
}

.dice-box button {
    background: var(--cor0);
    color: var(--cor1);
    border: none;
    padding: 12px 25px;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    font-size: 16px;
    transition: all 0.3s;
    margin-top: 10px;
}

.dice-box button:hover {
    background: #25e000;
    transform: scale(1.05);
}

/* Resultados dos dados */
.dice-results {
    margin-top: 20px;
}

.dice-roll-display {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
}

.dice-result-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 5px;
}

.dice-image {
    width: 60px;
    height: 60px;
    object-fit: contain;
    border: 2px solid #2CFF05;
    border-radius: 8px;
    background: #2B332A;
    padding: 5px;
    transition: all 0.3s;
}

.dice-image.success {
    border-color: #00ff00;
    box-shadow: 0 0 12px #00ff00;
}

.dice-image.failure {
    border-color: #ff4444;
    box-shadow: 0 0 12px #ff4444;
}

.dice-image.critical {
    border-color: #ffaa00;
    box-shadow: 0 0 15px #ffaa00;
    animation: pulse 0.5s infinite alternate;
}

.dice-value {
    width: 50px;
    height: 50px;
    background: #2B332A;
    border: 2px solid #2CFF05;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: bold;
    color: #2CFF05;
    margin-bottom: 5px;
    box-shadow: 0 0 8px rgba(44, 255, 5, 0.5);
}

/* Resumo centralizado */
.dice-summary {
    background: rgba(44, 255, 5, 0.1);
    border-radius: 10px;
    padding: 20px;
    margin-top: 20px;
    border: 1px solid var(--cor0);
    text-align: center;
}

.dice-summary h3 {
    color: var(--cor0);
    margin-bottom: 15px;
    font-size: 1.3em;
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    justify-items: center;
}

.summary-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.summary-value {
    font-size: 1.8em;
    font-weight: bold;
    color: var(--cor0);
    margin: 5px 0;
}

.summary-label {
    font-size: 0.9em;
    color: #ccc;
}

/* Footer */
.footer {
    text-align: center;
    margin-top: 25px;
    padding-top: 20px;
    border-top: 2px solid var(--cor0);
    color: var(--cor1);
    font-style: italic;
    font-size: 1.1em;
}

.footer-buttons {
    margin-top: 15px;
    display: flex;
    justify-content: center;
    gap: 15px;
}

.footer button {
    padding: 10px 20px;
    background: var(--cor0);
    color: var(--cor1);
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s;
    font-size: 14px;
}

.footer button:hover {
    transform: scale(1.05);
    box-shadow: 0 0 10px var(--cor0);
}

.footer button:last-child {
    background: var(--cor2);
    color: var(--cor3);
}

/* Responsividade */
@media (max-width: 768px) {
    body {
        padding: 10px;
        background-size: auto 50%; /* Reduz ainda mais o fundo em mobile */
    }
    
    .character-sheet {
        padding: 15px;
    }
    
    .header {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .attributes {
        grid-template-columns: 1fr;
    }
    
    .skills {
        grid-template-columns: 1fr;
    }
    
    .renome {
        grid-template-columns: 1fr;
    }
    
    .title {
        font-size: 2em;
    }
    
    .health-willpower-container {
        flex-direction: column;
        gap: 10px;
    }
    
    .dice-controls {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    body {
        background-size: auto 40%; /* Fundo ainda menor em telas pequenas */
    }
    
    .title {
        font-size: 1.6em;
    }
    
    .section-title {
        font-size: 1.2em;
    }
    
    .floating-images {
        height: 60px;
    }
    
    .floating-image {
        max-height: 50px;
        max-width: 80px;
    }
}

/* ==================== TOPO FIXO - APENAS IMAGEM ==================== */
.topo-fixo {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 170px; /* Altura do topo */
    background-image: url('imagens/fundo/topo1.png');
    
    /* IMAGEM INTEIRA SEM CORTES */
    background-size: contain;    /* Mostra imagem completa */
    background-position: center; /* Centraliza */
    background-repeat: no-repeat; /* Não repete */
    
    /* Cor de fundo para preencher espaços vazios */
    background-color: var(--cor4); /* Cor que combina com seu tema */
    
    border-radius: 3px solid var(--cor0);
    box-shadow: 0 5px 30px var(--cor4);
    z-index: 1000;
    cursor: pointer;
    transition: all 0.3s ease;
}

/* Efeitos interativos */
.topo-fixo:hover {
    border-bottom: 3px solid var(--cor0);
    box-shadow: 0 5px 35px var(--cor4);
}

.topo-fixo:active {
    transform: translateY(1px);
}

/* nome no meio das imagens flutuantes */
    .floating-images {
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 40px; /* espaço entre imagens e o nome */
      margin-bottom: 20px;
    }

    #nomeCentral {
      font-size: 5rem;
      font-weight: bold;
      color: var(--cor0);
      text-transform: uppercase; /* deixa em MAIÚSCULAS */
      text-shadow: 2px 2px 5px var(--cor1);
      font-family: var(--fonte-padrao);
    }

    .floating-image {
      width: 80px;
      height: 80px;
      object-fit: contain;
      border: 2px solid #2CFF05;
      border-radius: 8px;
      background-color: rgba(228, 215, 215, 0.13);
    }

    /* ação para dado */
    #dado {
  position: fixed;   /* fixa na tela, não dentro do container */
  bottom: 20px;      /* distância da parte de baixo */
  right: 20px;       /* distância da borda direita */
  width: 60px;
  height: 60px;
  background: #ffcc00;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  font-size: 1.5em;
  box-shadow: 0 4px 8px rgba(0,0,0,0.3);
  user-select: none;
}