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

body {
    font-family: 'Crimson Text', serif;
    background: linear-gradient(135deg, #1a1a2e, #16213e, #0f3460);
    color: #f0f0f0;
    min-height: 100vh;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
header {
    text-align: center;
    margin-bottom: 40px;
    padding: 30px 0;
}

header h1 {
    font-family: 'Cinzel', serif;
    font-size: 3rem;
    color: #ffd700;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
    margin-bottom: 10px;
    animation: glow 2s ease-in-out infinite alternate;
}

@keyframes glow {
    from { text-shadow: 2px 2px 4px rgba(0,0,0,0.5), 0 0 10px #ffd700; }
    to { text-shadow: 2px 2px 4px rgba(0,0,0,0.5), 0 0 20px #ffd700, 0 0 30px #ffd700; }
}

header p {
    font-size: 1.2rem;
    color: #b8b8b8;
    font-style: italic;
}

/* Cards gerais */
.card {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 215, 0, 0.3);
    border-radius: 15px;
    padding: 30px;
    margin: 20px 0;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 40px rgba(255, 215, 0, 0.2);
}

/* API Setup */
.api-setup {
    max-width: 600px;
    margin: 0 auto;
}

.api-setup h3 {
    color: #ffd700;
    margin-bottom: 20px;
    font-family: 'Cinzel', serif;
    text-align: center;
}

.api-setup ol {
    margin: 20px 0;
    padding-left: 20px;
}

.api-setup li {
    margin: 10px 0;
}

.api-setup a {
    color: #4fc3f7;
    text-decoration: none;
}

.api-setup a:hover {
    text-decoration: underline;
}

.api-setup input {
    width: 100%;
    padding: 15px;
    margin: 20px 0;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 215, 0, 0.5);
    border-radius: 8px;
    color: #f0f0f0;
    font-size: 16px;
}

.api-setup input::placeholder {
    color: #b8b8b8;
}

.api-setup button {
    width: 100%;
    padding: 15px;
    background: linear-gradient(45deg, #ffd700, #ffed4e);
    color: #1a1a2e;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

.api-setup button:hover {
    background: linear-gradient(45deg, #ffed4e, #ffd700);
    transform: translateY(-2px);
}

.note {
    font-size: 0.9rem;
    color: #b8b8b8;
    text-align: center;
    margin-top: 15px;
    font-style: italic;
}

.loading-setup {
    text-align: center;
    padding: 30px 0;
}

.loading-setup p {
    font-size: 1.2rem;
    color: #ffd700;
    margin-bottom: 20px;
    font-style: italic;
}

.mystical-loader {
    font-size: 1.5rem;
    animation: mysticalPulse 2s ease-in-out infinite;
    letter-spacing: 8px;
}

@keyframes mysticalPulse {
    0%, 100% { 
        opacity: 1; 
        transform: scale(1);
    }
    50% { 
        opacity: 0.7; 
        transform: scale(1.1);
    }
}

/* Seleção de modo */
.mode-selection h2 {
    text-align: center;
    color: #ffd700;
    font-family: 'Cinzel', serif;
    margin-bottom: 30px;
    font-size: 2rem;
}

.mode-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin: 30px 0;
}

.mode-card {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 215, 0, 0.3);
    border-radius: 20px;
    padding: 40px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.mode-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 50px rgba(255, 215, 0, 0.4);
    border-color: #ffd700;
}

.mode-icon {
    font-size: 4rem;
    margin-bottom: 20px;
    filter: drop-shadow(0 0 15px rgba(255, 215, 0, 0.6));
}

.mode-card h3 {
    color: #ffd700;
    margin-bottom: 15px;
    font-family: 'Cinzel', serif;
    font-size: 1.5rem;
}

.mode-card p {
    color: #b8b8b8;
    font-size: 1rem;
    line-height: 1.5;
}

/* Tipos de jogada */
.game-types h2 {
    text-align: center;
    color: #ffd700;
    font-family: 'Cinzel', serif;
    margin-bottom: 30px;
    font-size: 2rem;
}

.types-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin: 30px 0;
}

.type-card {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 215, 0, 0.3);
    border-radius: 15px;
    padding: 30px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.type-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 40px rgba(255, 215, 0, 0.3);
    border-color: #ffd700;
}

.type-card:before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 215, 0, 0.1), transparent);
    transition: left 0.5s;
}

.type-card:hover:before {
    left: 100%;
}

.type-icon {
    font-size: 3rem;
    margin-bottom: 15px;
    filter: drop-shadow(0 0 10px rgba(255, 215, 0, 0.5));
}

.type-card h3 {
    color: #ffd700;
    margin-bottom: 10px;
    font-family: 'Cinzel', serif;
}

.type-card p {
    color: #b8b8b8;
    font-size: 0.9rem;
}

/* Área de pergunta */
.question-area {
    max-width: 600px;
    margin: 0 auto;
}

.question-area h3 {
    color: #ffd700;
    text-align: center;
    margin-bottom: 20px;
    font-family: 'Cinzel', serif;
}

.question-area textarea {
    width: 100%;
    min-height: 120px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 215, 0, 0.5);
    border-radius: 10px;
    color: #f0f0f0;
    font-size: 16px;
    font-family: 'Crimson Text', serif;
    resize: vertical;
    margin-bottom: 20px;
}

.question-area textarea::placeholder {
    color: #b8b8b8;
}

.question-area button {
    width: 100%;
    padding: 15px;
    background: linear-gradient(45deg, #ffd700, #ffed4e);
    color: #1a1a2e;
    border: none;
    border-radius: 10px;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Cinzel', serif;
}

.question-area button:hover {
    background: linear-gradient(45deg, #ffed4e, #ffd700);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(255, 215, 0, 0.3);
}

/* Área das cartas */
.cards-area h2 {
    text-align: center;
    color: #ffd700;
    font-family: 'Cinzel', serif;
    margin-bottom: 30px;
    font-size: 2rem;
}

.cards-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
    margin: 30px 0;
}

.tarot-card {
    width: 150px;
    height: 250px;
    background: linear-gradient(135deg, #2c1810, #8b4513);
    border: 2px solid #ffd700;
    border-radius: 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.5s ease;
    position: relative;
    perspective: 1000px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

.tarot-card:hover {
    transform: scale(1.05) rotateY(5deg);
    box-shadow: 0 15px 40px rgba(255, 215, 0, 0.4);
}

.card-back {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1a1a2e, #8b4513);
    border-radius: 13px;
    position: relative;
    overflow: hidden;
}

.card-back:before {
    content: '';
    position: absolute;
    top: 10px;
    left: 10px;
    right: 10px;
    bottom: 10px;
    border: 1px solid #ffd700;
    border-radius: 8px;
}

.card-front {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #f4f4f4, #e0e0e0);
    border-radius: 13px;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    padding: 15px;
    color: #2c1810;
    text-align: center;
}

.card-front.revealed {
    display: flex;
}

.card-number {
    font-size: 1.2rem;
    font-weight: bold;
    color: #8b4513;
}

.card-name {
    font-size: 1rem;
    font-weight: bold;
    font-family: 'Cinzel', serif;
    text-align: center;
    line-height: 1.2;
}

.card-symbol {
    font-size: 3rem;
    margin: 10px 0;
}

.card-meaning {
    font-size: 0.8rem;
    color: #666;
    text-align: center;
    line-height: 1.2;
}

/* Botões de ação */
.reveal-btn, .new-game-btn {
    display: block;
    margin: 30px auto;
    padding: 15px 30px;
    background: linear-gradient(45deg, #ffd700, #ffed4e);
    color: #1a1a2e;
    border: none;
    border-radius: 25px;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Cinzel', serif;
    box-shadow: 0 5px 15px rgba(255, 215, 0, 0.3);
}

.reveal-btn:hover, .new-game-btn:hover {
    background: linear-gradient(45deg, #ffed4e, #ffd700);
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(255, 215, 0, 0.4);
}

/* Área de interpretação */
.interpretation-card {
    max-width: 800px;
    margin: 0 auto;
}

.interpretation-card h3 {
    color: #ffd700;
    text-align: center;
    margin-bottom: 25px;
    font-family: 'Cinzel', serif;
    font-size: 1.8rem;
}

.interpretation-text {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    padding: 25px;
    border-left: 4px solid #ffd700;
    font-size: 1.1rem;
    line-height: 1.8;
}

.loading {
    text-align: center;
    color: #ffd700;
    font-style: italic;
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Botão de voltar */
.back-btn {
    display: inline-block;
    margin: 20px auto;
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.1);
    color: #ffd700;
    border: 1px solid rgba(255, 215, 0, 0.5);
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Crimson Text', serif;
}

.back-btn:hover {
    background: rgba(255, 215, 0, 0.2);
    transform: translateY(-2px);
}

/* Modo conversa */
.conversation-mode {
    max-width: 800px;
    margin: 0 auto;
}

.chat-container {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 215, 0, 0.3);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.chat-header {
    background: rgba(255, 215, 0, 0.1);
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 215, 0, 0.3);
}

.chat-header h3 {
    color: #ffd700;
    font-family: 'Cinzel', serif;
    margin: 0;
}

.chat-messages {
    height: 400px;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.message {
    display: flex;
    gap: 10px;
    align-items: flex-start;
}

.user-message {
    flex-direction: row-reverse;
}

.message-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 215, 0, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.user-message .message-avatar {
    background: rgba(76, 175, 80, 0.2);
}

.message-content {
    background: rgba(255, 255, 255, 0.1);
    padding: 15px;
    border-radius: 15px;
    max-width: 70%;
    line-height: 1.5;
    border: 1px solid rgba(255, 215, 0, 0.2);
}

.user-message .message-content {
    background: rgba(76, 175, 80, 0.1);
    border-color: rgba(76, 175, 80, 0.3);
}

.chat-input-area {
    padding: 20px;
    border-top: 1px solid rgba(255, 215, 0, 0.3);
    display: flex;
    gap: 10px;
    align-items: center;
}

.chat-input-area input {
    flex: 1;
    padding: 12px 15px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 215, 0, 0.5);
    border-radius: 25px;
    color: #f0f0f0;
    font-size: 14px;
}

.chat-input-area input::placeholder {
    color: #b8b8b8;
}

.chat-input-area button {
    padding: 12px 20px;
    background: linear-gradient(45deg, #ffd700, #ffed4e);
    color: #1a1a2e;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: bold;
}

.chat-input-area button:hover {
    background: linear-gradient(45deg, #ffed4e, #ffd700);
    transform: translateY(-2px);
}

/* Botão dinâmico de carta no chat */
.chat-card-btn {
    display: inline-block;
    margin-top: 10px;
    padding: 10px 20px;
    background: linear-gradient(45deg, #8b4513, #cd853f);
    color: #fff;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: bold;
    font-size: 14px;
    box-shadow: 0 3px 10px rgba(139, 69, 19, 0.3);
}

.chat-card-btn:hover {
    background: linear-gradient(45deg, #cd853f, #8b4513);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(139, 69, 19, 0.4);
}

/* Carta revelada no chat */
.chat-card {
    background: linear-gradient(135deg, #f4f4f4, #e0e0e0);
    border-radius: 10px;
    padding: 15px;
    margin: 10px 0;
    text-align: center;
    color: #2c1810;
    border: 2px solid #ffd700;
    box-shadow: 0 5px 15px rgba(255, 215, 0, 0.3);
}

.chat-card .card-number {
    font-size: 1rem;
    font-weight: bold;
    color: #8b4513;
}

.chat-card .card-name {
    font-size: 1.2rem;
    font-weight: bold;
    font-family: 'Cinzel', serif;
    margin: 5px 0;
}

.chat-card .card-symbol {
    font-size: 2rem;
    margin: 10px 0;
}

.chat-card .card-meaning {
    font-size: 0.9rem;
    color: #666;
}

/* Footer */
footer {
    text-align: center;
    margin-top: 50px;
    padding: 20px;
    color: #b8b8b8;
    font-style: italic;
}

/* Responsividade */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    .types-grid {
        grid-template-columns: 1fr;
    }
    
    .cards-container {
        gap: 15px;
    }
    
    .tarot-card {
        width: 120px;
        height: 200px;
    }
    
    .card-symbol {
        font-size: 2.5rem;
    }
    
    .card-name {
        font-size: 0.9rem;
    }
    
    .card-meaning {
        font-size: 0.7rem;
    }
}