/* Reset e configurações gerais */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    
    font-family: 'Brush Script','Georgia', 'Times New Roman', serif;
    background: #ffffff;
    background-attachment: fixed;
    min-height: 100vh;
    
    line-height: 1.6;
    position: relative;
}

/* Efeito de textura no fundo */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

/* Header */
header {
    background: #ffffff;
    color: #2c2c2c;
    text-align: center;    
    box-shadow: 0 8px 32px rgba(218, 165, 32, 0.12);
    border-bottom: none;
    position: relative;
    z-index: 1;
    overflow: hidden;
    padding-bottom: 1rem;
    
}

.header-bar {
    background-color: #D35400;
    color:#fff;
    margin: 0;
    text-align: center;
    padding: 3px;
}

/* Efeito decorativo no header */
header::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -10%;
    width: 40%;
    height: 200%;
    
    transform: rotate(-15deg);
    pointer-events: none;
}

header::after {
    content: '';
    position: absolute;
    bottom: -50%;
    right: -10%;
    width: 40%;
    height: 200%;
    
    transform: rotate(-15deg);
    pointer-events: none;
}

/* Linha decorativa dourada */
header .header-line {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 4px;
  
}

header h1 {
    font-family: "Segoe Script", "Lucida Handwriting", cursive;
    font-size: 4rem;
    margin-bottom: 0.1rem;
    font-weight: 800;
    letter-spacing: 3px;
    background: #e2ad29;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    position: relative;
    display: inline-block;
    text-transform: none;
    
}

header h1::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 60%;
    height: 2px;
}

header p {
    font-size: 1.15rem;
    opacity: 0.7;
    font-style: italic;
    color: #5d5d5d;
    position: relative;
    max-width: 600px;
    margin: 0 auto;
    font-weight: 400;
    letter-spacing: 0.5px;
}

/* Main container */
main {
    max-width: 1400px;
    margin: 0 auto;
    padding: 3rem 1.5rem;
    position: relative;
    z-index: 1;
}

/* Grid de cartas */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2.5rem;
    animation: fadeIn 0.8s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Wrapper da carta + botão */
.card-wrapper {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    animation: slideIn 0.6s ease-out forwards;
    opacity: 0;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(40px) rotateX(10deg);
    }
    to {
        opacity: 1;
        transform: translateY(0) rotateX(0);
    }
}

/* Carta individual */
.card {
    width: 100%;
    aspect-ratio: 2/3;           /* proporção típica de cartas de baralho */
    justify-content: flex-end;
    display: flex;
    flex-direction: column;
    
    background-size:contain;
    border-radius: 12px;
    box-shadow: 
        0 8px 24px rgba(0, 0, 0, 0.08),
        0 0 0 1px rgba(218, 165, 32, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    position: relative;
    border: 0px solid rgba(218, 165, 32, 0.2);
    
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
}

.card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 
        0 16px 18px rgba(218, 165, 32, 0.25),
        0 0 0 2px rgba(218, 165, 32, 0.4),
        0 0 10px rgba(255, 215, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 1);
}

.card:hover::before {
    opacity: 1;
}

/* Imagem da carta */
.card-image {
    width: 100%;
    height: 220px;
    object-fit: cover;
   
    display: flex;
    align-items: center;
    justify-content: center;
    color: #8b7355;
    font-size: 4rem;
    font-weight: bold;
    position: relative;
    overflow: hidden;
}

.card-image::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        repeating-linear-gradient(
            45deg,
            transparent,
            transparent 10px,
            rgba(0, 0, 0, 0.05) 10px,
            rgba(0, 0, 0, 0.05) 20px
        );
    pointer-events: none;
}

.card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: brightness(0.9) contrast(1.1);
}

/* Conteúdo da carta */
.card-content {
    padding: 0.5rem;
    height: calc(100% - 230px);
    background: #ffffff
}

.card-title {
    font-size: 1rem;
    font-weight: 700;
    color: #555555;
    margin-bottom: 0.20rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    text-shadow: 1px 1px 2px rgba(218, 165, 32, 0.1);
    letter-spacing: 1px;
}

.card-subtitle {
    font-size: 0.80rem;
    font-weight: 700;
    color: #b900009f;
    margin-bottom: 0.3rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    text-shadow: 1px 1px 2px rgba(218, 165, 32, 0.1);
    letter-spacing: 1px;
}

.card-description {
    font-size: 0.85rem;
    color: #5d5d5d;
    line-height: 1.2;
    font-style: italic;
    border-bottom: 1px solid #e2ad29;
    padding-bottom: 5px;
}

.card-description2 {
    padding-top: 5px;
    font-size: 0.85rem;
    color: #5d5d5d;
    line-height: 1.2;
    font-style: italic;
    font-weight: 100;
    
}

.audio-button {
    background: #e2ad29;
    color: #ffffff;
    border: none;
    padding: 0.85rem 1.5rem;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    transition: all 0.3s ease;
    width: 100%;
    justify-content: center;
    box-shadow: 
        0 4px 12px rgba(212, 175, 55, 0.35),
        inset 0 1px 0 rgba(255, 255, 255, 0.3),
        inset 0 -1px 0 rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.2);
}

.audio-button::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.audio-button:hover::before {
    width: 300px;
    height: 300px;
}

.audio-button:hover {
    transform: scale(1.05);
    box-shadow: 
        0 3px 10px rgba(212, 175, 55, 0.55),
        0 0 25px rgba(255, 215, 0, 0.25),
        inset 0 1px 0 rgba(255, 255, 255, 0.4),
        inset 0 -1px 0 rgba(0, 0, 0, 0.15);
    background: #e2ad29;
}

.audio-button:active {
    transform: scale(0.95);
}

.audio-button.playing {
    background: #e2ad29;
    animation: pulse 1.5s infinite;
    box-shadow: 
        0 4px 12px #b8860b,
        0 0 30px #b8860b;
}


@keyframes pulse {
    0%, 100% {
        opacity: 1;
        box-shadow: 
            0 4px 12px #b8860b,
            0 0 30px #d4af37;
    }
    50% {
        opacity: 0.85;  
        box-shadow: 
        0 4px 12px #b8860b,
        0 0 40px #d4af37;
    }
}

/* Ícone de áudio */
.audio-icon {
    width: 22px;
    height: 22px;
    display: inline-block;
    position: relative;
    z-index: 1;
}

.default-button {
    background: #16A085;
    color: #ffffff;
    border: none;
    padding: 0.85rem 1.5rem;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    transition: all 0.3s ease;
    width: 20%;
    justify-content: center;
    box-shadow: 
        0 4px 12px #16a0842f,
        inset 0 1px 0 rgba(255, 255, 255, 0.3),
        inset 0 -1px 0 rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.2);
    margin: 0 auto; /* Centers the button horizontally */
    text-decoration: none;
}

@media (max-width: 768px) {
    .default-button {
        width: 50%; /* Adjusts the button width for smaller screens */
    }
}

@media (max-width: 480px) {
    .default-button {
        width: 70%; /* Further adjusts the button width for very small screens */
    }
}

.default-button::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.default-button:hover::before {
    width: 300px;
    height: 300px;
}

.default-button:hover {
    transform: scale(1.05);
    box-shadow: 
        0 3px 10px #16a0842f
        0 0 25px rgba(255, 215, 0, 0.25),
        inset 0 1px 0 rgba(255, 255, 255, 0.4),
        inset 0 -1px 0 rgba(0, 0, 0, 0.15);
    background: #16A085;
}

/* Footer */
footer {
    background: #D35400;
    color: #ffffff;
    text-align: center;
    padding: 1rem;
    margin-top: 4rem;
    box-shadow: 0 -4px 20px rgba(218, 165, 32, 0.1);
    border-top: 2px solid rgba(218, 165, 32, 0.3);
    position: relative;
    z-index: 1;
}

/* Responsividade */
@media (max-width: 768px) {
    header h1 {
        font-size: 3rem;
    }
    
    header p {
        font-size: 1rem;
    }
    
    .cards-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 2rem;
    }
    
    main {
        padding: 2rem 1rem;
    }
}

@media (max-width: 480px) {
    .cards-grid {
        grid-template-columns: 1fr;
    }
    
    header h1 {
        font-size: 2.5rem;
    }
    
    .card-title {
        font-size: 1rem;
    }
}

/* Placeholder para imagens */
.card-image-placeholder {
   
    display: flex;
    flex: 2;
    align-items: center;
    justify-content: center;
    color: #8b7355;
    font-size: 4.5rem;
    font-weight: bold;
    text-shadow: 2px 2px 4px rgba(218, 165, 32, 0.2);
    position: relative;
    overflow: hidden;
}

.card-image-placeholder img {
    width: 100%;        /* preenche toda a largura da div */
    height: 100%;       /* preenche toda a altura da div */
    object-fit: cover;  /* mantém proporção e corta o excesso */
    display: block;
  }

.card-image-placeholder::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        repeating-linear-gradient(
            45deg,
            transparent,
            transparent 10px,
            rgba(0, 0, 0, 0.05) 10px,
            rgba(0, 0, 0, 0.05) 20px
        );
    pointer-events: none;
}

.rules{
    margin-top: 3rem;
    margin-bottom: 2rem;
    padding: 1rem 1.5rem;
    background: #fff8e1;
    border-left: 6px solid #e2ad29;
    box-shadow: 0 4px 12px rgba(218, 165, 32, 0.1);

}
.rules h2 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    text-align: center;
}

/* Loading state */
.loading {
    text-align: center;
    padding: 3rem;
    font-size: 1.2rem;
    color: #5d5d5d;
}

/* Delay progressivo para cada carta */
.card-wrapper:nth-child(1) { animation-delay: 0.05s; }
.card-wrapper:nth-child(2) { animation-delay: 0.1s; }
.card-wrapper:nth-child(3) { animation-delay: 0.15s; }
.card-wrapper:nth-child(4) { animation-delay: 0.2s; }
.card-wrapper:nth-child(5) { animation-delay: 0.25s; }
.card-wrapper:nth-child(6) { animation-delay: 0.3s; }
.card-wrapper:nth-child(7) { animation-delay: 0.35s; }
.card-wrapper:nth-child(8) { animation-delay: 0.4s; }
.card-wrapper:nth-child(9) { animation-delay: 0.45s; }
.card-wrapper:nth-child(10) { animation-delay: 0.5s; }
.card-wrapper:nth-child(11) { animation-delay: 0.55s; }
.card-wrapper:nth-child(12) { animation-delay: 0.6s; }

/* Efeito de brilho nas cartas */
.card::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        45deg,
        transparent 30%,
        rgba(255, 255, 255, 0.03) 50%,
        transparent 70%
    );
    transform: rotate(45deg);
    transition: all 0.6s ease;
    pointer-events: none;
}

.card:hover::after {
    left: 100%;
}

/* Scrollbar customizada */
::-webkit-scrollbar {
    width: 12px;
}

::-webkit-scrollbar-track {
    background: #f5f1e8;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #b8860b 0%, #daa520 100%);
    border-radius: 6px;
    border: 2px solid #f5f1e8;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #daa520 0%, #ffd700 100%);
}



/* Container do PDF */
.pdf-viewer {
    position: relative;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    margin: 40px auto;
    width: 100%;
    max-width: 100%;
    height: 100vh;
    display: flex;
    flex-direction: column;
  }

  /* Barra superior do leitor */
  .pdf-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: white;
    padding: 10px 10px;
    font-weight: 500;
    background-color: #D35400;
  }

  .pdf-toolbar span {
    font-size: 0.95rem;

  }

  .text-toolbar {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #D35400;
    padding: 20px 5px;
    font-weight: 900;
    background-color: #fff;
  }

  .text-toolbar span {
    font-size: 0.95rem;

  }

  #pdf-container {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
    scroll-behavior: smooth;
  }

  canvas {
    width: 100%;
    display: block;
    
    margin-bottom: 15px;
    border-radius: 5px;
  }

  /* Loader */
  #loading {
    text-align: center;
    padding: 30px;
    font-size: 1rem;
    color: #666;
  }