@import url('https://fonts.googleapis.com/css2?family=Eagle+Lake&family=Fondamento:ital@0;1&family=Pirata+One&display=swap');

:root {
    --quill-ink: #1a1714;
    --royal-ink: #6b0000;
    --gold-leaf: #d4af37;
    --wax-red: #8b0000;
}

/* 1. Global Scribe's Environment */
body {
    background-color: #080808;
    background-image: url('https://www.transparenttextures.com/patterns/dark-stone.png');
    /* Handwritten body font: Fondamento (Calligraphic) */
    font-family: 'Fondamento', cursive;
    font-size: 1.4rem;
    color: var(--quill-ink);
    margin: 0;
    padding: 0;
}

/* 2. The Great Manuscript (The Parchment) */
.medieval-scroll {
    background-image: url('../img/parchment.jpg');
    background-size: 100% 100%;
    background-repeat: no-repeat;
    max-width: 1200px; /* Increased from 1000px */
    margin: 30px auto;
    padding: 120px 8%; /* Reduced horizontal padding from 12% to 8% */
    min-height: 100vh;
    position: relative;
    z-index: 10;
    
    /* Physical object depth */
    box-shadow: 0 50px 150px rgba(0,0,0,0.9);
    
    /* Simulate hand-laid paper */
    transform: rotate(-0.3deg);
}

/* 3. The Handwritten Ink Effect */
.medieval-scroll * {
    mix-blend-mode: multiply; /* Absorbs into the parchment */
    opacity: 0.95;
}

/* 4. Handwritten Typography */
h1, h2, h3, h4, h5 {
    font-family: 'Pirata One', cursive; /* Gothic for big headers */
    color: var(--royal-ink);
    text-align: center;
}

/* Sub-headers use Eagle Lake for a "titled handwriting" look */
h3, h4, .navbar-brand {
    font-family: 'Eagle Lake', cursive !important;
}

h1.display-4 {
    font-size: clamp(1rem, 7vw, 4.5rem) !important;
    white-space: nowrap; /* Force one line */
    overflow: hidden;
    text-overflow: ellipsis;
    /* Hand-drawn underline */
    border-bottom: 3px solid transparent;
    border-image: radial-gradient(circle, var(--royal-ink) 0%, transparent 100%) 1;
    padding-bottom: 10px;
    margin-bottom: 20px; /* Reduced margin */
    display: block;
    width: 100%;
}

.medieval-subtitle {
    font-family: 'Fondamento', cursive;
    font-size: clamp(1.2rem, 4vw, 2.5rem);
    color: var(--royal-ink);
    margin-bottom: 40px;
    font-style: italic;
    mix-blend-mode: multiply;
}

.medieval-hr {
    height: 3px;
    border: none;
    border-bottom: 3px solid transparent;
    border-image: radial-gradient(circle, var(--royal-ink) 0%, transparent 100%) 1;
    margin: 40px auto;
    width: 100%;
}

/* 5. Hand-Drawn Cards (Sketchy Borders) */
.card {
    background: transparent;
    border: none;
    margin-bottom: 50px;
}

.card-header {
    background: transparent;
    border-bottom: 2px solid var(--quill-ink);
    font-family: 'Eagle Lake', cursive;
    color: var(--quill-ink);
    font-size: 1.8rem;
    /* Irregular underline */
    border-radius: 255px 15px 225px 15px/15px 225px 15px 255px;
}

.card-body {
    padding: 20px 0;
    font-style: italic; /* Makes it feel more like personal writing */
}

/* 6. Hand-Painted Navigation (Iron & Ink) */
.navbar {
    background: #111 !important;
    border-bottom: 4px solid var(--gold-leaf);
    box-shadow: 0 10px 40px #000;
}

.navbar-brand {
    font-size: 2.2rem !important;
    color: var(--gold-leaf) !important;
    text-shadow: 2px 2px 0px #000;
}

.nav-link {
    font-family: 'Eagle Lake', cursive;
    color: #cbb896 !important;
    font-size: 1.1rem;
    margin: 0 10px;
}

.nav-link:hover {
    color: var(--gold-leaf) !important;
    text-decoration: underline wavy var(--gold-leaf);
}

/* 7. The Wax Seal Buttons (Hand-Pressed) */
.btn-primary {
    background: var(--wax-red);
    background-image: radial-gradient(circle at 40% 40%, #a50000, #5a0000);
    border: 1px solid #000;
    color: var(--gold-leaf);
    font-family: 'Eagle Lake', cursive;
    font-size: 1.2rem;
    /* Hand-poured irregular shape */
    border-radius: 60% 40% 70% 30% / 30% 60% 40% 70%;
    padding: 15px 35px;
    box-shadow: 5px 5px 15px #000;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    transform: scale(1.05) rotate(2deg);
    color: #fff;
    box-shadow: 10px 10px 25px #000;
}

/* 8. Hand-Penned Form Inputs */
.form-control {
    background: transparent;
    border: none;
    /* Sketchy underline look */
    border-bottom: 2px solid var(--quill-ink);
    font-family: 'Fondamento', cursive;
    font-size: 1.4rem;
    color: var(--quill-ink);
    border-radius: 0;
    padding: 10px 0;
}

.form-control:focus {
    background: rgba(0, 0, 0, 0.02);
    box-shadow: none;
    border-bottom-color: var(--royal-ink);
}

/* 9. The Handwritten Countdown (Fully Transparent & Inline) */
#countdown {
    background: transparent !important;
    border: none;
    padding: 20px !important;
    margin-top: 20px;
    box-shadow: none;
    display: flex;
    flex-direction: column;
    align-items: center;
}

#countdown .row {
    flex-wrap: nowrap !important; /* Force all timer parts onto one line */
    justify-content: center;
    width: 100%;
}

#countdown .bg-white {
    background: transparent !important; /* No box background */
    border: none;
    color: var(--royal-ink) !important;
    box-shadow: none;
    padding: 0 15px !important;
    display: flex;
    flex-direction: column;
    align-items: center;
}

#countdown h2 {
    color: var(--royal-ink);
    mix-blend-mode: multiply;
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

#countdown span.h2 {
    font-family: 'Pirata One', cursive;
    font-size: clamp(1.5rem, 5vw, 3.5rem) !important;
    color: var(--royal-ink) !important;
    mix-blend-mode: multiply;
    margin: 0;
    display: block;
}

#countdown .text-muted {
    color: var(--quill-ink) !important;
    font-family: 'Eagle Lake', cursive;
    text-transform: uppercase;
    font-size: 0.8rem;
    mix-blend-mode: multiply;
    display: block;
}

/* 10. The Dungeon Vault Footer */
footer {
    background: #000 !important;
    border-top: 5px solid var(--gold-leaf);
    padding: 80px 0 !important;
    color: var(--gold-leaf) !important;
    font-family: 'Eagle Lake', cursive;
    font-size: 1.8rem;
}

.medieval-table {
    border: 1px solid rgba(0,0,0,0.1);
}

.medieval-table th, .medieval-table td {
    padding: 12px;
}

@media (max-width: 768px) {
    .medieval-scroll {
        margin: 0;
        padding: 60px 8%;
        transform: none;
    }
    h1.display-4 {
        font-size: 1.8rem !important; /* Fixed size for mobile to ensure it fits */
    }
    #countdown .row {
        flex-wrap: wrap !important; /* Allow wrapping on very small screens if necessary */
    }
    .medieval-table {
        font-size: 0.8rem; /* Even smaller font for mobile */
    }
    .medieval-table th, .medieval-table td {
        padding: 6px 2px; /* Tightest padding */
    }
}
