:root {
    --orange-sol: #fba002;
    --azul-marea: #0f9e99;
    --blanco-espuma: #efe9e0;
    --negro-chetao: #151814;
    --font-main: 'Inter', sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-main);
    background-color: var(--blanco-espuma);
    color: var(--negro-chetao);
    height: 100vh; /* Fallback */
    height: 100dvh; /* Mobile viewport fix */
    display: flex;
    justify-content: center;
    overflow: hidden; /* Prevent body scroll */
    position: relative;
    overscroll-behavior: none; /* Prevent bounce */
}

/* Background Animation - Top Down Beach */
.beach-background {
    position: absolute; /* Changed from fixed to absolute within fixed body */
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background-color: var(--blanco-espuma);
    overflow: hidden;
}

/* Sand Texture */
.sand-texture {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at top left, #fff5e6 0%, var(--blanco-espuma) 100%);
    z-index: 0;
}

.sand-texture::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='0.15'/%3E%3C/svg%3E");
    opacity: 0.6;
    mix-blend-mode: multiply;
}

/* Beach Decorations */
.beach-decorations {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}

.decor {
    position: absolute;
    opacity: 0.8;
    filter: drop-shadow(2px 4px 6px rgba(0,0,0,0.2));
}

.shell {
    color: #e6c2a0;
    width: 40px;
    height: 40px;
}

.shell-1 {
    top: 12%;
    left: 8%;
    width: 50px;
    height: 50px;
    transform: rotate(45deg);
    filter: drop-shadow(3px 3px 4px rgba(0,0,0,0.15));
}

.shell-2 {
    bottom: 35%;
    right: 12%;
    transform: rotate(-20deg);
    width: 45px;
    height: 45px;
    color: #dcb490;
    filter: drop-shadow(2px 4px 5px rgba(0,0,0,0.15));
}

.shell-3 {
    top: 40%;
    left: 15%;
    width: 25px;
    height: 25px;
    transform: rotate(100deg);
    opacity: 0.6;
}

.starfish {
    color: #ff8a65;
    width: 55px;
    height: 55px;
    top: 55%;
    right: 8%;
    transform: rotate(15deg);
    filter: drop-shadow(2px 3px 4px rgba(0,0,0,0.2));
}

.espeto {
    width: 90px;
    height: 180px;
    bottom: 65%; /* Moved up significantly to avoid water */
    right: 5%;
    transform: rotate(-10deg);
    filter: drop-shadow(8px 12px 15px rgba(0,0,0,0.4));
    z-index: 2; /* Ensure it's above water if tide rises high */
}

/* Ocean Tide Container */
.ocean-tide {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

/* Wave Layers */
.wave-layer {
    position: absolute;
    bottom: -15%; /* Raised slightly */
    left: -10%;
    width: 120%;
    height: 100%;
    /* More transparent gradient for water look */
    background: linear-gradient(to top, rgba(15, 158, 153, 0.6) 0%, rgba(15, 158, 153, 0.2) 50%, rgba(15, 158, 153, 0) 100%);
    border-radius: 50% 50% 0 0 / 10% 10% 0 0; /* Flatter curve */
    transform-origin: bottom center;
    will-change: transform;
    backdrop-filter: blur(1px); /* Slight blur to things under water */
}

/* Foam Effect on top of waves - Improved */
.wave-layer::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 40px;
    /* Complex gradient for foam texture */
    background: radial-gradient(circle at 50% 0, rgba(255,255,255,0.9) 0%, rgba(255,255,255,0.5) 40%, transparent 80%);
    background-size: 20px 100%; /* Repeat pattern */
    filter: blur(4px);
    opacity: 0.9;
    border-radius: 50% 50% 0 0 / 100% 100% 0 0;
}

/* Layer 1: Deep water */
.layer-1 {
    height: 65%;
    opacity: 0.6;
    animation: tideMove 14s ease-in-out infinite;
    background: linear-gradient(to top, rgba(10, 107, 103, 0.8) 0%, rgba(15, 158, 153, 0.4) 80%, transparent 100%);
}

/* Layer 2: Mid water */
.layer-2 {
    height: 60%;
    opacity: 0.5;
    animation: tideMove 14s ease-in-out infinite;
    animation-delay: -4s;
    background: linear-gradient(to top, rgba(15, 158, 153, 0.5) 0%, rgba(15, 158, 153, 0.2) 80%, transparent 100%);
}

/* Layer 3: Wash / Foam edge */
.layer-3 {
    height: 55%;
    opacity: 0.9; /* Increased opacity */
    animation: tideMove 14s ease-in-out infinite;
    animation-delay: -8s;
    /* Made the water body more solid so it doesn't look empty when it rises above other layers */
    background: linear-gradient(to top, rgba(15, 158, 153, 0.85) 0%, rgba(15, 158, 153, 0.6) 70%, rgba(255, 255, 255, 0.4) 95%, transparent 100%);
}

/* Add extra foam line to Layer 3 for the "wet sand" look */
.layer-3::before {
    content: "";
    position: absolute;
    top: 2%; 
    left: 0;
    width: 100%;
    height: 15px;
    background: rgba(255, 255, 255, 0.85);
    filter: blur(6px);
    border-radius: 50%;
    box-shadow: 0 2px 10px rgba(255, 255, 255, 0.9);
}

@keyframes tideMove {
    0%, 100% {
        transform: translateY(40%) scaleY(0.9); /* Marea baja - el agua se retira */
    }
    50% {
        transform: translateY(-5%) scaleY(1.1); /* Marea alta - el agua sube */
    }
}

/* Removed duplicate container definition */

/* Header */
.profile {
    text-align: center;
    margin-bottom: 40px;
    animation: fadeInDown 1s ease-out;
}

.avatar-container {
    width: 120px;
    height: 120px;
    margin: 0 auto 20px;
    border-radius: 50%;
    overflow: hidden;
    border: 4px solid rgba(255, 255, 255, 0.5);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
    background-color: white;
    display: flex;
    align-items: center;
    justify-content: center;
}

.avatar {
    width: 100%;
    height: auto;
    object-fit: contain;
}

.username {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--negro-chetao);
    margin-bottom: 10px;
    letter-spacing: -0.5px;
}

.bio {
    font-size: 1rem;
    line-height: 1.5;
    color: rgba(21, 24, 20, 0.8);
    font-weight: 600;
}

/* Links */
.links {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.link-card {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(10px);
    padding: 6px;
    border-radius: 16px;
    text-decoration: none;
    color: var(--negro-chetao);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    border: 1px solid rgba(255, 255, 255, 0.4);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    position: relative;
    overflow: hidden;
    animation: fadeInUp 0.8s ease-out backwards;
    /* Prevent text selection on touch */
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}

/* Staggered animation for links */
.link-card:nth-child(1) { animation-delay: 0.1s; }
.link-card:nth-child(2) { animation-delay: 0.2s; }
.link-card:nth-child(3) { animation-delay: 0.3s; }
.link-card:nth-child(4) { animation-delay: 0.4s; }
.link-card:nth-child(5) { animation-delay: 0.5s; }

.link-card:hover {
    transform: translateY(-4px) scale(1.02);
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 12px 24px rgba(15, 158, 153, 0.2); /* Blue shadow on hover */
    border-color: var(--orange-sol);
}

.thumbnail {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    overflow: hidden;
    flex-shrink: 0;
    background-color: #f0f0f0;
}

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

.link-text {
    flex-grow: 1;
    text-align: center;
    font-weight: 700;
    font-size: 1rem;
    padding: 0 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.icon-arrow {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--azul-marea);
    opacity: 0;
    transform: translateX(-10px);
    transition: all 0.3s ease;
}

.link-card:hover .icon-arrow {
    opacity: 1;
    transform: translateX(0);
}

/* Footer */
.footer {
    margin-top: 60px;
    font-size: 0.85rem;
    color: rgba(21, 24, 20, 0.7);
    text-align: center;
    animation: fadeIn 1.5s ease-out;
    font-weight: 500;
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.5);
}

.mania-link {
    color: var(--azul-marea);
    font-weight: 700;
    text-decoration: none;
    padding: 2px 4px;
    border-bottom: 2px solid transparent;
    transition: all 0.3s ease;
}

.mania-link:hover {
    color: var(--orange-sol);
    border-bottom-color: var(--orange-sol);
    background-color: rgba(255, 255, 255, 0.5);
    border-radius: 4px;
}

/* Animations */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Responsive */
@media (max-width: 480px) {
    .username {
        font-size: 1.5rem;
    }
    
    .link-card {
        padding: 5px;
    }
    
    .thumbnail {
        width: 42px;
        height: 42px;
    }
    
    .link-text {
        font-size: 0.9rem;
    }

    .footer {
        display: flex;
        flex-direction: column;
        gap: 4px;
        padding-bottom: 20px; /* Ensure it's not too close to edge */
    }
    
    .mania-link {
        display: inline-block;
    }
}

.container {
    width: 100%;
    max-width: 680px;
    height: 100%; /* Full height */
    padding: 40px 20px 120px 20px; /* Extra bottom padding for scroll */
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 1;
    overflow-y: auto; /* Scrollable content */
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch; /* Smooth scroll on iOS */
    scrollbar-width: none; /* Hide scrollbar Firefox */
}

.container::-webkit-scrollbar {
    display: none; /* Hide scrollbar Chrome/Safari */
}
