:root {
    --accent-turquoise: #15b8a6;
    --accent-glow: rgba(21, 184, 166, 0.4);
    
    /* THEME JOUR (Blue Sky) */
    --bg-gradient: linear-gradient(-45deg, #f0fdfa, #ffffff, #e0f2fe, #ccfbf1);
    --text-main: #0f172a; 
    --text-muted: #475569; 
    --glass-bg: rgba(255, 255, 255, 0.6);
    --glass-border: rgba(255, 255, 255, 1);
    --glass-shadow: rgba(0, 0, 0, 0.05);
    --glass-highlight-bg: rgba(21, 184, 166, 0.1);
    --glass-highlight-border: rgba(21, 184, 166, 0.4);
    --highlight-text: #0f766e;
    --avatar-border: #ffffff;
    --ripple-color: rgba(0, 0, 0, 0.05);
    --btn-hover-bg: rgba(255, 255, 255, 0.9);
}

[data-theme="dark"] {
    /* THEME NUIT (Galactique) */
    --bg-gradient: linear-gradient(-45deg, #020617, #0f172a, #1e1b4b, #020617);
    --text-main: #f8fafc; 
    --text-muted: #cbd5e1; 
    --glass-bg: rgba(255, 255, 255, 0.03);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-shadow: rgba(0, 0, 0, 0.3);
    --glass-highlight-bg: rgba(21, 184, 166, 0.1);
    --glass-highlight-border: rgba(21, 184, 166, 0.3);
    --highlight-text: #5eead4;
    --avatar-border: var(--accent-turquoise);
    --ripple-color: rgba(255, 255, 255, 0.1);
    --btn-hover-bg: rgba(255, 255, 255, 0.08);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    -webkit-tap-highlight-color: transparent;
}

body {
    background: var(--bg-gradient);
    background-size: 400% 400%;
    animation: gradientBG 15s ease infinite;
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    padding: 3rem 1.5rem;
    position: relative;
    overflow-x: hidden;
    transition: color 0.5s ease;
}

/* =========================================
   EFFET GRAIN PHOTOGRAPHIQUE (NOUVEAU)
========================================= */
body::before {
    content: "";
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    /* Génère un bruit blanc texturé très léger */
    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.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
    opacity: 0.04; /* Très subtil pour ne pas gêner la lecture */
    z-index: 1; 
    pointer-events: none;
}

#sky-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

.age-gate-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.2); backdrop-filter: blur(20px);
    display: flex; justify-content: center; align-items: center;
    z-index: 9999; padding: 1.5rem;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}
.age-gate-overlay.hidden { opacity: 0; visibility: hidden; }

.age-gate-card {
    background: var(--glass-bg); border: 1px solid var(--glass-border);
    border-radius: 24px; padding: 2.5rem 1.5rem; text-align: center;
    max-width: 400px; box-shadow: 0 15px 40px rgba(0, 0, 0, 0.2);
    transform: translateY(0); transition: transform 0.5s ease, background 0.5s ease;
}
.age-gate-overlay.hidden .age-gate-card { transform: translateY(30px) scale(0.95); }

.warning-icon { font-size: 3rem; color: var(--accent-turquoise); margin-bottom: 1rem; }
.age-gate-card h2 { font-size: 1.5rem; margin-bottom: 0.5rem; }
.age-gate-card p { font-size: 0.95rem; color: var(--text-muted); margin-bottom: 2rem; line-height: 1.5; }
.age-gate-actions { display: flex; flex-direction: column; gap: 1rem; }
.age-btn { padding: 1rem; border-radius: 12px; font-size: 1rem; font-weight: 600; cursor: pointer; text-decoration: none; transition: all 0.2s ease; }
.age-btn.primary { background: var(--accent-turquoise); color: #ffffff; border: none; box-shadow: 0 4px 15px var(--accent-glow); }
.age-btn.primary:hover { background: #0d9488; transform: scale(1.02); }
.age-btn.secondary { background: transparent; color: var(--text-muted); border: 1px solid var(--text-muted); }

/* Le conteneur passe en z-index 2 pour être au-dessus du grain */
.container {
    width: 100%; max-width: 500px;
    display: flex; flex-direction: column; gap: 2rem;
    z-index: 2; opacity: 0;
}

.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    margin-bottom: -1rem;
}

.action-btn {
    width: 45px; height: 45px;
    border-radius: 50%;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(12px);
    color: var(--text-main);
    display: flex; justify-content: center; align-items: center;
    font-size: 1.25rem; cursor: pointer;
    box-shadow: 0 4px 15px var(--glass-shadow);
    transition: transform 0.2s ease, background 0.3s ease, border 0.3s ease, color 0.3s ease;
}

.action-btn:hover {
    transform: scale(1.1);
    background: var(--btn-hover-bg);
}

.profile-header { text-align: center; }
.avatar-container { display: inline-block; position: relative; margin-bottom: 1rem; animation: floating 5s ease-in-out infinite; }
.avatar { width: 110px; height: 110px; border-radius: 50%; object-fit: cover; border: 3px solid var(--avatar-border); box-shadow: 0 10px 25px var(--accent-glow); transition: border-color 0.5s ease; }
.profile-header h1 { font-size: 1.75rem; font-weight: 700; margin-bottom: 0.5rem; }
.profile-header .bio { font-size: 0.95rem; color: var(--text-muted); line-height: 1.5; }

.link-group { display: flex; flex-direction: column; gap: 1.2rem; }
.link-group h2 { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 2px; text-align: center; color: var(--accent-turquoise); font-weight: 700; }

.link-btn {
    position: relative;
    display: flex; align-items: center; justify-content: center; gap: 0.75rem;
    width: 100%; min-height: 56px; padding: 1rem;
    background: var(--glass-bg); border: 1px solid var(--glass-border);
    backdrop-filter: blur(12px); border-radius: 16px;
    color: var(--text-main); text-decoration: none;
    font-weight: 600; font-size: 1.05rem;
    box-shadow: 0 8px 32px var(--glass-shadow);
    transition: transform 0.3s ease, background 0.3s ease, border-color 0.3s ease, color 0.3s ease;
    opacity: 0; transform: translateY(30px);
}

.link-btn:hover { background: var(--btn-hover-bg); }

.link-btn.highlight {
    background: var(--glass-highlight-bg);
    border: 1px solid var(--glass-highlight-border);
    color: var(--highlight-text);
}
.link-btn.highlight:hover { background: rgba(21, 184, 166, 0.15); }

.link-icon {
    width: 24px;
    height: 24px;
    object-fit: contain;
    flex-shrink: 0; 
}

.ripple {
    position: absolute; border-radius: 50%; transform: scale(0);
    animation: ripple-click 0.6s linear;
    background-color: var(--ripple-color); pointer-events: none;
}
.link-btn.highlight .ripple { background-color: rgba(21, 184, 166, 0.2); }

@keyframes gradientBG { 0% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } 100% { background-position: 0% 50%; } }
@keyframes floating { 0%, 100% { transform: translateY(0px); } 50% { transform: translateY(-10px); } }
@keyframes ripple-click { to { transform: scale(4); opacity: 0; } }
@keyframes fadeInUpElastic { to { opacity: 1; transform: translateY(0); } }

.container.loaded { opacity: 1; transition: opacity 0.5s ease; }
.container.loaded .link-btn { animation: fadeInUpElastic 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) forwards; }
.container.loaded .link-group:nth-of-type(1) .link-btn:nth-child(2) { animation-delay: 0.1s; }
.container.loaded .link-group:nth-of-type(1) .link-btn:nth-child(3) { animation-delay: 0.2s; }
.container.loaded .link-group:nth-of-type(1) .link-btn:nth-child(4) { animation-delay: 0.3s; }
.container.loaded .link-group:nth-of-type(1) .link-btn:nth-child(5) { animation-delay: 0.4s; }
.container.loaded .link-group:nth-of-type(2) .link-btn:nth-child(2) { animation-delay: 0.55s; }
.container.loaded .link-group:nth-of-type(2) .link-btn:nth-child(3) { animation-delay: 0.65s; }
.container.loaded .link-group:nth-of-type(2) .link-btn:nth-child(4) { animation-delay: 0.75s; }

@media (max-width: 480px) {
    body { padding: 2rem 1rem; }
    .container { gap: 1.5rem; }
}