@tailwind base;
@tailwind components;
@tailwind utilities;

:root {
    --color-bg-start: #0f172a;
    --color-bg-end: #020617;
    --color-accent-gold: #fde047;
    --color-accent-cyan: #67e8f9;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Lato', sans-serif;
    overflow-x: hidden;
}

#background-gradient {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at top right, rgba(22, 78, 99, 0.4), transparent 40%),
                radial-gradient(circle at bottom left, rgba(71, 85, 105, 0.4), transparent 50%),
                var(--color-bg-start);
    background-color: var(--color-bg-start);
    z-index: 0;
}

.font-cinzel {
    font-family: 'Cinzel', serif;
}

.font-lato {
    font-family: 'Lato', sans-serif;
}

.text-shadow-gold {
    color: var(--color-accent-gold);
    text-shadow: 0 0 5px rgba(253, 224, 71, 0.3), 0 0 10px rgba(253, 224, 71, 0.2);
}

.toc-link {
    display: block;
    padding: 0.75rem 1rem;
    background-color: rgba(30, 41, 59, 0.7);
    border: 1px solid #334155;
    border-radius: 0.5rem;
    font-family: 'Cinzel', serif;
    font-weight: 700;
    color: #94a3b8;
    transition: all 0.3s ease;
}

.toc-link:hover {
    background-color: rgba(51, 65, 85, 0.9);
    color: var(--color-accent-cyan);
    transform: translateY(-3px);
    box-shadow: 0 0 15px rgba(103, 232, 249, 0.3);
}

.character-card {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.character-card.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.prose-invert table {
    background-color: rgba(15, 23, 42, 0.5);
}

.prose-invert thead {
    color: var(--color-accent-cyan);
    border-bottom-color: #475569;
}

.prose-invert tbody tr {
    border-bottom-color: #334155;
}

.prose-invert td, .prose-invert th {
    padding: 0.75rem 1rem;
}

.portrait-fallback {
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Cinzel', serif;
    font-size: 4rem;
    font-weight: 700;
    color: var(--color-accent-gold);
    background: radial-gradient(circle at 30% 30%, rgba(103, 232, 249, 0.25), rgba(15, 23, 42, 0.9));
}

.icon-inline {
    display: inline-block;
    vertical-align: middle;
    width: 1.5rem;
    height: 1.5rem;
    margin-left: 0.5rem;
    border-radius: 4px;
    background-color: rgba(255,255,255,0.1);
}

.table-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 1rem 0;
    border-radius: 0.5rem;
    max-width: 100%;
}

.character-card .grid,
.prose,
.character-card > .grid > div {
    min-width: 0;
}

.table-scroll table {
    margin: 0;
    min-width: 480px;
}

@media (max-width: 480px) {
    .prose {
        font-size: 0.95rem;
    }

    .toc-link {
        padding: 0.6rem 0.5rem;
        font-size: 0.85rem;
    }
}

.loader {
    width: 48px;
    height: 48px;
    border: 3px solid #FFF;
    border-radius: 50%;
    display: inline-block;
    position: relative;
    box-sizing: border-box;
    animation: rotation 1s linear infinite;
    margin: 2rem auto;
}
.loader::after {
    content: '';  
    box-sizing: border-box;
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 3px solid;
    border-color: var(--color-accent-cyan) transparent;
}

@keyframes rotation {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}
