/* Dreamlike Alice in Wonderland Theme */
@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&family=Great+Vibes&family=Special+Elite&display=swap');

/* Body styling */
body {
    margin: 0;
    padding: 0;
    background: #0a0a0a; /* Fallback black */
    overflow: hidden;
    font-family: 'Special Elite', cursive;
    color: #e6e6fa; /* Lavender text */
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.8);
    cursor: url('Art/sparkle_cursor.cur'), auto;
}

/* Rabbit hole container */
.rabbit-hole {
    position: relative;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background: transparent; /* Ensure ::before is visible */
    overflow: hidden;
}

/* Victorian-style wallpaper tunnel with enhanced wavy warping and zoomed-in pattern */
.rabbit-hole::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 200%; /* Double height for scrolling */
    background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="120" height="120" viewBox="0 0 120 120"><defs><pattern id="arabesque" width="120" height="120" patternUnits="userSpaceOnUse"><rect width="120" height="120" fill="%231a2b3a"><animate attributeName="fill" values="%231a2b3a;%233a4b5a;%232a3b4a;%231a2b3a" dur="11s" repeatCount="indefinite"/></rect><path d="M60 0 Q90 30 60 60 Q90 90 60 120 Q30 90 60 60 Q30 30 60 0 Z M60 0 Q90 30 60 60 Q30 90 60 120 Q30 30 60 60 Q90 30 60 0 Z M0 60 Q30 30 60 60 Q30 90 0 60 M120 60 Q90 90 60 60 Q90 30 120 60 Z" fill="%234a6b7a"><animate attributeName="fill" values="%234a6b7a;%237a5a8a;%238a4a5a;%234a6b7a" dur="10s" repeatCount="indefinite"/></path><path d="M60 0 Q90 30 60 60 Q90 90 60 120 Q30 90 60 60 Q30 30 60 0 Z M60 0 Q90 30 60 60 Q30 90 60 120 Q30 30 60 60 Q90 30 60 0 Z M0 60 Q30 30 60 60 Q30 90 0 60 M120 60 Q90 90 60 60 Q90 30 120 60 Z" fill="%236a8a6a" fill-opacity="0.5" transform="translate(60,60) scale(0.5) translate(-60,-60) rotate(45,60,60)"><animate attributeName="fill" values="%236a8a6a;%23c17a9a;%23d38a5a;%236a8a6a" dur="12s" repeatCount="indefinite"/></path><path d="M60 60 Q90 90 120 60 Q90 30 60 60 Q30 30 0 60 Q30 90 60 60 Z" fill="%235a7a8a" fill-opacity="0.3"><animate attributeName="fill" values="%235a7a8a;%23a1b45a;%23d3af7a;%235a7a8a" dur="14s" repeatCount="indefinite"/></path><path d="M10 10 Q15 15 20 10 Q15 5 10 10" fill="none" stroke="%23ffffff" stroke-opacity="0.1" stroke-width="1"/><path d="M100 100 Q105 105 110 100 Q105 95 100 100" fill="none" stroke="%23ffffff" stroke-opacity="0.1" stroke-width="1"/></pattern></defs><rect width="120" height="120" fill="url(%23arabesque)"/></svg>') repeat;
    background-size: 150px 150px; /* Zoomed in to hide outlines */
    opacity: 0.8; /* Slightly reduced for softer effect */
    z-index: -1; /* Behind everything */
    filter: url(#wavy-warp); /* Apply SVG filter */
    animation: tunnel-fall 12s linear infinite;
}

@keyframes tunnel-fall {
    0% { transform: translateY(0%); }
    100% { transform: translateY(-50%); }
}

/* Reaper silhouette */
.reaper-silhouette {
    position: absolute;
    top: 0;
    left: -200px;
    width: 200px;
    height: 100vh;
    background: url('https://images-wixmp-ed30a86b8c4ca887773594c2.wixmp.com/f/8595b01c-3927-4d86-a88d-71839c7d9a42/dipilw6-5f2d4abd-dd4c-4706-aeb3-3df8b885b0f0.png/v1/fill/w_894,h_894/pixel_grim_reaper_by_designbypotatos_dipilw6-pre.png?token=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJ1cm46YXBwOjdlMGQxODg5ODIyNjQzNzNhNWYwZDQxNWVhMGQyNmUwIiwiaXNzIjoidXJuOmFwcDo3ZTBkMTg4OTgyMjY0MzczYTVmMGQ0MTVlYTBkMjZlMCIsIm9iaiI6W1t7ImhlaWdodCI6Ijw9NDAwMCIsInBhdGgiOiJcL2ZcLzg1OTViMDFjLTM5MjctNGQ4Ni1hODhkLTcxODM5YzdkOWE0MlwvZGlwaWx3Ni01ZjJkNGFiZC1kZDRjLTQ3MDYtYWViMy0zZGY4Yjg4NWIwZjAucG5nIiwid2lkdGgiOiI8PTQwMDAifV1dLCJhdWQiOlsidXJuOnNlcnZpY2U6aW1hZ2Uub3BlcmF0aW9ucyJdfQ.E6ebEMHxarmZo8u8SQjFwCvM0pvwJkA9ch5YhMsYDN0') no-repeat center/contain;
    opacity: 0.1;
    animation: drift-reaper 30s infinite linear;
    pointer-events: none;
    z-index: 0;
}

@keyframes drift-reaper {
    0% { transform: translateX(-200px); }
    100% { transform: translateX(120vw); }
}

/* Falling objects */
.falling-objects {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none; /* Prevent clicks on container */
    z-index: 0; /* Behind content and alice-mouse */
}

.falling-object {
    position: absolute;
    opacity: 0.7;
    animation: rise linear infinite;
    filter: drop-shadow(0 0 5px #ffd700);
    pointer-events: none; /* Non-clickable */
}

.falling-card {
    animation: rise-card linear infinite;
}

@keyframes rise {
    0% { transform: translateY(100vh) rotate(0deg); }
    100% { transform: translateY(-100vh) rotate(-360deg); }
}

@keyframes rise-card {
    0% { transform: translateY(100vh) rotateY(0deg); }
    50% { transform: translateY(0vh) rotateY(180deg); }
    100% { transform: translateY(-100vh) rotateY(360deg); }
}

/* Content container */
.content {
    background: url('Art/parchment_texture.png') repeat, rgba(255, 245, 238, 0.95);
    padding: 30px;
    padding-bottom: 40px; /* Extra space for glitter underline */
    border: 4px double #ffd700;
    border-radius: 15px;
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.7);
    max-width: 650px;
    text-align: center;
    position: relative;
    z-index: 1;
    overflow: visible; /* Ensure no clipping of glitter underline */
}

/* Ensure content background is behind text and glitter */
.content::before, .content::after {
    content: '♠';
    position: absolute;
    font-size: 2em;
    color: #b22222;
    opacity: 0.5;
}

.content::before {
    top: 10px;
    left: 10px;
}

.content::after {
    bottom: 10px;
    right: 10px;
    transform: rotate(180deg);
}

/* Typewriter container */
.typewriter {
    padding-bottom: 20px; /* Extra space for glitter underline */
    overflow: visible; /* Ensure no clipping */
    position: relative; /* Create stacking context */
    z-index: 2; /* Above content background */
}

/* Typewriter effect */
.typewriter p {
    margin: 10px 0;
    font-family: 'Special Elite', cursive;
    font-size: 1.2em;
    color: #1a1a1a;
    white-space: nowrap; /* Prevent wrapping during animation */
    overflow: hidden; /* Hide text until typed */
    opacity: 0;
    transition: opacity 0.3s;
    text-shadow: 0 0 5px #ffd700;
    position: relative;
    display: inline-block;
    text-align: left;
    z-index: 2; /* Above content background */
    line-height: 1.2; /* Consistent spacing for descenders */
    min-height: 1.2em; /* Ensure enough height for positioning */
}

.typewriter p.typing {
    opacity: 1;
    animation: typing 2s steps(40) forwards;
}

.typewriter p.typing::after {
    content: '|';
    position: absolute;
    right: 0;
    color: #b22222;
    font-weight: bold;
    animation: blink-caret 0.75s step-end infinite;
}

.typewriter p.typed {
    opacity: 1;
    animation: none;
}

.typewriter p.typed::after {
    content: none;
}

.typewriter p::before {
    content: '';
    position: absolute;
    left: 0;
    bottom: -8px; /* Closer to the text */
    width: 100%;
    height: 15px; /* Keep for visibility */
    background: url('Art/glitter.png') repeat-x;
    background-size: auto 100%; /* Scale image height to 12px */
    opacity: 1; /* Full opacity */
    z-index: -1; /* Behind the text */
}

/* Typing animation */
@keyframes typing {
    from { width: 0; }
    to { width: 100%; }
}

/* Blinking caret animation */
@keyframes blink-caret {
    from, to { opacity: 0; }
    50% { opacity: 1; }
}

/* Buttons */
.buttons {
    margin-top: 20px;
    display: flex;
    justify-content: center;
    gap: 20px;
}

.age-button {
    padding: 10px 20px;
    font-family: 'Great Vibes', cursive;
    font-size: 1.5em;
    border: 2px solid #ffd700;
    border-radius: 10px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s, filter 0.2s;
    position: relative;
    background: linear-gradient(45deg, #b22222, #4b0082);
    color: #e6e6fa;
}

.age-button::before {
    content: '♥';
    position: absolute;
    top: -10px;
    left: -10px;
    font-size: 1em;
    color: #ffd700;
    opacity: 0.7;
}

.age-button:hover {
    transform: scale(1.1);
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.7);
    filter: url(#pixelate);
}

/* Audio player */
.audio-player {
    margin-top: 20px;
    text-align: center;
    z-index: 2;
}

.audio-toggle {
    padding: 8px 15px;
    background: url('Art/card_texture.png'), white;
    color: #1a1a1a;
    font-family: 'Press Start 2P', cursive;
    font-size: 0.9em;
    border: 2px solid #b22222;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    position: relative;
}

.audio-toggle::after {
    content: '♦';
    position: absolute;
    bottom: -10px;
    right: -10px;
    font-size: 0.8em;
    color: #b22222;
}

.audio-toggle:hover {
    transform: scale(1.05);
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.7);
}

.audio-fallback {
    margin-top: 5px;
    color: #1a1a1a;
    font-family: 'Special Elite', cursive;
    font-size: 0.9em;
    display: none;
}

/* Geocities footer */
.geocities-footer {
    margin-top: 20px;
    text-align: center;
}

.under-construction {
    width: 100px;
    height: auto;
}

/* Alice mouse follower */
.alice-mouse {
    position: fixed;
    width: 150px;
    height: 150px;
    pointer-events: none;
    z-index: 3;
    --glow-r: 100;
    --glow-g: 180;
    --glow-b: 255; /* Initial RGB for glow */
    --hue: 0; /* Hue for image shift */
    filter: drop-shadow(0 0 5px rgb(var(--glow-r), var(--glow-g), var(--glow-b))) drop-shadow(0 0 10px rgb(var(--glow-r), var(--glow-g), var(--glow-b))) hue-rotate(calc(var(--hue) * 0.3deg)); /* Glow + subtle image tint */
}

/* Ghost trail */
.ghost-trail {
    position: absolute;
    width: 150px;
    height: 150px;
    background: url('Art/alice_mouse.gif') no-repeat center/contain;
    opacity: 0.5;
    pointer-events: none;
    z-index: 2;
    --glow-r: 100;
    --glow-g: 180;
    --glow-b: 255; /* Same initial RGB */
    --hue: 0; /* Same hue for image shift */
    filter: drop-shadow(0 0 5px rgb(var(--glow-r), var(--glow-g), var(--glow-b))) drop-shadow(0 0 10px rgb(var(--glow-r), var(--glow-g), var(--glow-b))) hue-rotate(calc(var(--hue) * 0.3deg)); /* Matching glow + tint */
    animation: ghost-fade 5s ease-out forwards;
}

/* Ghost fade animation */
@keyframes ghost-fade {
    0% { opacity: 0.5; }
    100% { opacity: 0; }
}

/* SVG Filters */
svg {
    position: absolute;
    width: 0;
    height: 0;
}

/* Pixelation filter */
@keyframes pixelate {
    0% { filter: url(#pixelate); }
    100% { filter: none; }
}