/* Variables du thème alchimique */
:root {
    --bg-primary: #0a0a0f;
    --bg-secondary: #12121a;
    --bg-card: rgba(20, 20, 35, 0.8);
    --bg-content: #ECE8DC;
    --text-primary: #e8e6e3;
    --text-secondary: #9ca3af;
    --text-dark: #2d2a24;
    --accent-purple: #7c3aed;
    --accent-purple-light: #a78bfa;
    --accent-gold: #d4af37;
    --accent-gold-light: #f4d03f;
    --success-color: #4ade80;
    --error-color: #f87171;
    --border-color: rgba(124, 58, 237, 0.3);
    --glow-purple: 0 0 20px rgba(124, 58, 237, 0.5);
    --glow-gold: 0 0 20px rgba(212, 175, 55, 0.5);
    
    /* Couleurs livre ancien */
    --book-cover: #3d2914;
    --book-cover-light: #5c3d1e;
    --book-spine: #2a1d0d;
    --book-page: #f4efe4;
    --book-page-dark: #e8e0d0;
    --book-page-edge: #d4c9b5;
    --book-ink: #1a1612;
    --book-ink-faded: #4a4035;
}

/* Reset et base */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: 'Crimson Text', Georgia, serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.7;
    overflow-x: hidden;
}

/* Top Bar */
.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1.5rem;
    background: rgba(10, 10, 15, 0.9);
    border-bottom: 1px solid var(--border-color);
    position: relative;
    z-index: 10;
}

.top-bar-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.top-bar-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.85rem;
    transition: color 0.3s ease;
    font-family: 'Inter', sans-serif;
}

.top-bar-link:hover {
    color: var(--accent-gold);
}

.top-bar-link svg {
    width: 18px;
    height: 18px;
}

/* Chronomètre */
.timer {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-family: 'Cinzel', serif;
    font-size: 0.9rem;
    color: var(--text-secondary);
    opacity: 0.8;
}

.timer svg {
    width: 16px;
    height: 16px;
}

.timer-value {
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.05em;
}

/* Fond étoilé animé */
.stars {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    background-image: 
        radial-gradient(2px 2px at 20px 30px, #eee, transparent),
        radial-gradient(2px 2px at 40px 70px, rgba(255,255,255,0.8), transparent),
        radial-gradient(1px 1px at 90px 40px, #fff, transparent),
        radial-gradient(2px 2px at 160px 120px, rgba(255,255,255,0.9), transparent),
        radial-gradient(1px 1px at 230px 80px, #eee, transparent),
        radial-gradient(2px 2px at 300px 150px, #fff, transparent),
        radial-gradient(1px 1px at 370px 50px, rgba(255,255,255,0.7), transparent),
        radial-gradient(2px 2px at 450px 180px, #eee, transparent),
        radial-gradient(1px 1px at 520px 90px, #fff, transparent),
        radial-gradient(2px 2px at 600px 130px, rgba(255,255,255,0.8), transparent);
    background-size: 650px 200px;
    animation: starsMove 120s linear infinite;
    opacity: 0.6;
    z-index: 0;
}

.stars-2 {
    background-size: 400px 300px;
    animation-duration: 80s;
    animation-direction: reverse;
    opacity: 0.4;
}

@keyframes starsMove {
    from { transform: translateY(0); }
    to { transform: translateY(-200px); }
}

/* Cercle alchimique décoratif */
.alchemy-circle {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 800px;
    height: 800px;
    border: 1px solid rgba(124, 58, 237, 0.1);
    border-radius: 50%;
    pointer-events: none;
    z-index: 0;
    animation: rotateCircle 120s linear infinite;
}

.alchemy-circle::before,
.alchemy-circle::after {
    content: '';
    position: absolute;
    border: 1px solid rgba(212, 175, 55, 0.08);
    border-radius: 50%;
}

.alchemy-circle::before {
    top: 10%;
    left: 10%;
    right: 10%;
    bottom: 10%;
}

.alchemy-circle::after {
    top: 25%;
    left: 25%;
    right: 25%;
    bottom: 25%;
    border-color: rgba(124, 58, 237, 0.1);
}

@keyframes rotateCircle {
    from { transform: translate(-50%, -50%) rotate(0deg); }
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Container principal */
.app-container {
    position: relative;
    z-index: 1;
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    min-height: calc(100vh - 100px);
    display: flex;
    flex-direction: column;
}

/* Encart promo */
.promo-banner {
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.2), rgba(212, 175, 55, 0.2));
    border: 1px solid var(--accent-gold);
    border-radius: 10px;
    padding: 1rem 1.5rem;
    margin-bottom: 1.5rem;
    text-align: center;
    animation: fadeIn 0.5s ease;
}

.promo-banner p {
    margin: 0;
    color: var(--text-primary);
    font-size: 0.95rem;
}

.promo-banner a {
    color: var(--accent-gold);
    font-weight: 600;
    text-decoration: underline;
}

.promo-banner a:hover {
    color: var(--accent-gold-light);
}

/* En-tête */
.header {
    text-align: center;
    padding: 2rem 0 3rem;
}

.logo {
    font-family: 'Cinzel', serif;
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--accent-gold);
    text-shadow: var(--glow-gold);
    margin-bottom: 0.5rem;
    letter-spacing: 0.1em;
}

.subtitle {
    font-family: 'Crimson Text', serif;
    font-style: italic;
    color: var(--text-secondary);
    font-size: 1.1rem;
}

/* Bouton Indices */
.indices-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1.5rem;
    padding: 0.75rem 1.5rem;
    background: rgba(212, 175, 55, 0.1);
    border: 1px solid var(--accent-gold);
    border-radius: 8px;
    color: var(--accent-gold);
    font-family: 'Cinzel', serif;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.indices-btn:hover {
    background: rgba(212, 175, 55, 0.2);
    box-shadow: var(--glow-gold);
}

.indices-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 1rem;
    animation: fadeIn 0.3s ease;
}

.modal {
    background: var(--bg-secondary);
    border: 1px solid var(--accent-gold);
    border-radius: 16px;
    width: 100%;
    max-width: 500px;
    padding: 2rem;
    animation: modalIn 0.3s ease;
}

@keyframes modalIn {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

.modal h3 {
    font-family: 'Cinzel', serif;
    color: var(--accent-gold);
    margin-bottom: 1.5rem;
    text-align: center;
}

.indices-list {
    list-style: none;
    margin-bottom: 1.5rem;
}

.indices-list li {
    padding: 1rem;
    background: rgba(212, 175, 55, 0.1);
    border-radius: 8px;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.indices-list li::before {
    content: '✧';
    color: var(--accent-gold);
}

.indice-locked {
    opacity: 0.4;
    font-style: italic;
}

.modal-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.modal-btn {
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-family: 'Cinzel', serif;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.modal-btn-primary {
    background: var(--accent-gold);
    border: none;
    color: var(--bg-primary);
}

.modal-btn-secondary {
    background: transparent;
    border: 1px solid var(--text-secondary);
    color: var(--text-secondary);
}

.no-indices {
    text-align: center;
    color: var(--text-secondary);
    font-style: italic;
    padding: 1rem;
}

/* Zone de saisie */
.input-section {
    background: var(--bg-card);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 2rem;
    margin-bottom: 2rem;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.code-input {
    flex: 1;
    font-family: 'Cinzel', serif;
    font-size: 1.2rem;
    padding: 1rem 1.5rem;
    background: rgba(10, 10, 15, 0.8);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: 0.2em;
    transition: all 0.3s ease;
}

.code-input:focus {
    outline: none;
    border-color: var(--accent-purple);
    box-shadow: var(--glow-purple);
}

.code-input::placeholder {
    color: var(--text-secondary);
    text-transform: none;
    letter-spacing: normal;
    font-family: 'Crimson Text', serif;
    font-style: italic;
}

.submit-btn {
    font-family: 'Cinzel', serif;
    font-size: 1rem;
    padding: 1rem 2rem;
    background: linear-gradient(135deg, var(--accent-purple), #5b21b6);
    border: none;
    border-radius: 8px;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.submit-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: var(--glow-purple);
}

.submit-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.validation-indicator {
    position: absolute;
    right: -3rem;
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    transition: all 0.3s ease;
    opacity: 0;
}

.validation-indicator.success {
    opacity: 1;
    background: var(--success-color);
    color: var(--bg-primary);
    animation: popIn 0.3s ease;
}

.validation-indicator.error {
    opacity: 1;
    background: var(--error-color);
    color: var(--bg-primary);
    animation: shake 0.3s ease;
}

@keyframes popIn {
    0% { transform: scale(0); }
    70% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

.status-message {
    text-align: center;
    padding: 1rem;
    margin-top: 1rem;
    border-radius: 8px;
    font-style: italic;
    animation: fadeIn 0.3s ease;
}

.status-message.error {
    color: var(--error-color);
    background: rgba(248, 113, 113, 0.1);
}

.status-message.success {
    color: var(--success-color);
    background: rgba(74, 222, 128, 0.1);
}

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

/* ============================== */
/* ZONE DE CONTENU - STYLE PARCHEMIN SOMBRE */
/* ============================== */

.content-area {
    flex: 1;
    position: relative;
    margin: 0 auto;
    width: 100%;
    max-width: 900px;
}

/* Conteneur principal avec bordure ornementale */
.book-wrapper {
    position: relative;
    background: linear-gradient(135deg, rgba(30, 25, 20, 0.9) 0%, rgba(20, 18, 15, 0.95) 100%);
    border: 2px solid rgba(212, 175, 55, 0.3);
    border-radius: 12px;
    padding: 4px;
    box-shadow: 
        0 20px 60px rgba(0, 0, 0, 0.5),
        inset 0 0 30px rgba(0, 0, 0, 0.3),
        0 0 0 1px rgba(212, 175, 55, 0.1);
}

/* Décoration dorée intérieure */
.book-decoration {
    position: absolute;
    top: 12px;
    right: 12px;
    bottom: 12px;
    left: 12px;
    border: 1px solid rgba(212, 175, 55, 0.2);
    border-radius: 8px;
    pointer-events: none;
}

.book-decoration::before {
    content: '';
    position: absolute;
    top: 8px;
    right: 8px;
    bottom: 8px;
    left: 8px;
    border: 1px solid rgba(212, 175, 55, 0.1);
    border-radius: 6px;
}

/* Pages intérieures */
.book-pages {
    position: relative;
    background: rgba(15, 13, 11, 0.6);
    border-radius: 8px;
    min-height: 500px;
    padding: 3rem;
    
    /* Texture subtile */
    background-image: 
        radial-gradient(ellipse at top left, rgba(212, 175, 55, 0.03) 0%, transparent 50%),
        radial-gradient(ellipse at bottom right, rgba(124, 58, 237, 0.03) 0%, transparent 50%);
}

/* Progression */
.progress-indicator {
    text-align: center;
    margin-bottom: 2rem;
    color: var(--accent-gold);
    font-family: 'Cinzel', serif;
    font-size: 0.85rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    padding: 0.5rem 1.5rem;
    border-top: 1px solid rgba(212, 175, 55, 0.3);
    border-bottom: 1px solid rgba(212, 175, 55, 0.3);
    display: inline-block;
}

.progress-wrapper {
    text-align: center;
    margin-bottom: 2rem;
}

/* Éléments de contenu */
.intro-box,
.current-reveal,
.final-code-section,
.final-message {
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 0;
    margin-bottom: 2.5rem;
    position: relative;
}

/* Séparateur ornemental */
.intro-box::after,
.current-reveal::after {
    content: '❧';
    display: block;
    text-align: center;
    font-size: 1.5rem;
    color: var(--accent-gold);
    margin-top: 2rem;
    opacity: 0.5;
}

.intro-box h3,
.current-reveal h3 {
    font-family: 'Cinzel', serif;
    font-size: 1.4rem;
    color: var(--accent-gold);
    margin-bottom: 1.5rem;
    text-align: center;
    font-weight: 600;
    letter-spacing: 0.05em;
    position: relative;
    padding-bottom: 1rem;
}

/* Soulignement ornemental */
.intro-box h3::after,
.current-reveal h3::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 2px;
    background: linear-gradient(to right, transparent, var(--accent-gold), transparent);
}

.intro-box p {
    color: var(--text-primary);
    line-height: 1.9;
    text-align: justify;
    font-size: 1.05rem;
    text-indent: 2em;
}

.intro-box .intro-image,
.current-reveal img {
    width: 100%;
    height: auto;
    margin-top: 1.5rem;
    border: none;
    box-shadow: 
        0 4px 20px rgba(0, 0, 0, 0.15),
        0 0 0 1px var(--book-page-edge);
    cursor: pointer;
    transition: all 0.3s ease;
}

.intro-box .intro-image:hover,
.current-reveal img:hover {
    box-shadow: 
        0 8px 30px rgba(0, 0, 0, 0.2),
        0 0 0 2px var(--accent-gold);
}

/* Animation révélation */
.current-reveal.just-revealed {
    animation: revealFade 0.8s ease;
}

@keyframes revealFade {
    0% { opacity: 0; transform: translateY(20px); }
    100% { opacity: 1; transform: translateY(0); }
}

.current-reveal.just-revealed img {
    animation: imageGlow 1.5s ease;
}

@keyframes imageGlow {
    0% { box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15), 0 0 0 1px var(--book-page-edge); }
    50% { box-shadow: 0 4px 40px rgba(212, 175, 55, 0.4), 0 0 0 2px var(--accent-gold); }
    100% { box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15), 0 0 0 1px var(--book-page-edge); }
}

/* Zone code final */
.final-code-section {
    background: rgba(212, 175, 55, 0.05);
    border: 1px dashed rgba(212, 175, 55, 0.5);
    border-radius: 8px;
    padding: 2rem;
    margin: 2rem 0;
}

.final-code-section::after {
    display: none;
}

.final-code-section h4 {
    font-family: 'Crimson Text', serif;
    font-style: italic;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
    text-align: center;
    line-height: 1.6;
}

.final-code-section .input-wrapper {
    max-width: 450px;
    margin: 0 auto;
}

.final-code-section .code-input {
    background: rgba(10, 10, 15, 0.8);
    border: 2px solid var(--border-color);
    color: var(--text-primary);
    font-size: 1rem;
}

.final-code-section .code-input:focus {
    border-color: var(--accent-gold);
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.2);
}

.final-code-section .code-input::placeholder {
    color: var(--text-secondary);
}

.final-code-section .submit-btn {
    background: linear-gradient(135deg, var(--accent-gold), #a88c2a);
    color: #1a1612;
}

.final-code-section .status-message.error {
    color: var(--error-color);
    background: rgba(248, 113, 113, 0.1);
}

.final-code-section .status-message.success {
    color: var(--success-color);
    background: rgba(74, 222, 128, 0.1);
}

/* Message final */
.final-message {
    text-align: center;
    padding: 2rem;
    background: linear-gradient(to bottom, rgba(212, 175, 55, 0.1), transparent);
    border-radius: 8px;
    animation: celebrationPulse 0.6s ease;
}

.final-message::after {
    display: none;
}

@keyframes celebrationPulse {
    0% { opacity: 0; transform: scale(0.9); }
    50% { transform: scale(1.02); }
    100% { opacity: 1; transform: scale(1); }
}

.final-message h3 {
    font-family: 'Cinzel', serif;
    color: var(--accent-gold);
    margin-bottom: 1rem;
    font-size: 1.8rem;
    animation: titleShine 2s ease infinite;
}

.final-message h3::after {
    display: none;
}

@keyframes titleShine {
    0%, 100% { text-shadow: 0 0 0 transparent; }
    50% { text-shadow: 0 0 20px rgba(212, 175, 55, 0.5); }
}

.final-message .final-time {
    font-family: 'Cinzel', serif;
    font-size: 1.3rem;
    color: var(--accent-gold);
    margin-bottom: 1.5rem;
}

.final-message p {
    color: var(--text-primary);
    line-height: 1.8;
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
}

.final-message a {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: #c13584;
    text-decoration: none;
    font-weight: 600;
    padding: 0.75rem 1.5rem;
    border: 2px solid #c13584;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.final-message a:hover {
    background: #c13584;
    color: white;
}

.final-message a svg {
    width: 20px;
    height: 20px;
}

/* Miniatures */
.past-pages {
    margin: 2rem 0;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(212, 175, 55, 0.3);
}

.past-pages-title {
    font-family: 'Cinzel', serif;
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.thumbnails-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.thumbnail {
    width: 70px;
    height: 70px;
    border-radius: 4px;
    overflow: hidden;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
    position: relative;
}

.thumbnail:hover {
    transform: scale(1.1) rotate(-2deg);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
}

.thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.thumbnail-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.75);
    color: white;
    font-size: 0.6rem;
    padding: 0.2rem;
    text-align: center;
    font-family: 'Cinzel', serif;
}

/* Reset bouton */
.reset-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 0.8rem;
    opacity: 0.5;
    margin-top: 2rem;
    font-family: 'Crimson Text', serif;
    font-style: italic;
}

.reset-btn:hover {
    opacity: 0.8;
    color: var(--accent-gold);
}

/* Lightbox */
.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.95);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 2rem;
    animation: fadeIn 0.3s ease;
}

.lightbox-content {
    max-width: 90vw;
    max-height: 80vh;
    text-align: center;
}

.lightbox-content h3 {
    font-family: 'Cinzel', serif;
    color: var(--accent-gold);
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.lightbox-content img {
    max-width: 100%;
    max-height: 70vh;
    border-radius: 4px;
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.5);
}

.lightbox-close {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    background: none;
    border: 2px solid var(--text-secondary);
    color: var(--text-secondary);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-close:hover {
    border-color: var(--accent-gold);
    color: var(--accent-gold);
}

.lightbox-nav {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
}

.lightbox-nav button {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--text-secondary);
    color: var(--text-primary);
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    font-family: 'Cinzel', serif;
    transition: all 0.3s ease;
}

.lightbox-nav button:hover:not(:disabled) {
    background: var(--accent-gold);
    border-color: var(--accent-gold);
    color: var(--bg-primary);
}

.lightbox-nav button:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

/* Confettis */
.confetti-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 3000;
    overflow: hidden;
}

.confetti {
    position: absolute;
    width: 10px;
    height: 10px;
    top: -10px;
    animation: confettiFall linear forwards;
}

.confetti:nth-child(odd) {
    border-radius: 50%;
}

@keyframes confettiFall {
    0% { transform: translateY(0) rotate(0deg); opacity: 1; }
    100% { transform: translateY(100vh) rotate(720deg); opacity: 0; }
}

/* Loader */
.loader {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Footer */
.footer {
    text-align: center;
    padding: 1.5rem;
    color: var(--text-secondary);
    font-size: 0.8rem;
    border-top: 1px solid var(--border-color);
    margin-top: 2rem;
}

.footer a {
    color: var(--text-secondary);
    text-decoration: none;
}

.footer a:hover {
    color: var(--accent-gold);
}

/* Responsive */
@media (max-width: 768px) {
    .app-container {
        padding: 1rem;
    }
    
    .logo {
        font-size: 1.8rem;
    }
    
    .input-wrapper {
        flex-direction: column;
    }
    
    .code-input {
        width: 100%;
        font-size: 1rem;
    }
    
    .submit-btn {
        width: 100%;
    }
    
    .validation-indicator {
        display: none;
    }
    
    .alchemy-circle {
        width: 400px;
        height: 400px;
    }

    .book-wrapper {
        padding: 8px 8px 8px 14px;
        border-radius: 3px 12px 12px 3px;
    }

    .book-wrapper::before {
        width: 12px;
    }

    .book-wrapper::after {
        left: 12px;
        width: 4px;
    }

    .book-decoration {
        left: 20px;
        top: 15px;
        right: 15px;
        bottom: 15px;
    }

    .book-pages {
        padding: 1.5rem;
        min-height: 400px;
    }

    .thumbnail {
        width: 55px;
        height: 55px;
    }

    .top-bar {
        flex-direction: column;
        gap: 0.5rem;
    }

    .top-bar-left {
        width: 100%;
        justify-content: center;
    }

    .timer {
        margin-top: 0.5rem;
    }

    .lightbox-content h3 {
        font-size: 1.1rem;
    }

    .final-code-section .input-wrapper {
        flex-direction: column;
    }

    .intro-box h3,
    .current-reveal h3 {
        font-size: 1.2rem;
    }
}

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

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent-purple);
}
