/* Face Component Styles - Verified Isosceles Center Layout */

:root {
    /* -----------------------------
     ISOSCELES GEOMETRY
     ----------------------------- */

    /* 1. Define Fixed Sizes (or Dynamic VW/VH) */
    --eye-w: min(180px, 30vw);
    --eye-h: min(50px, 10vh);
    --mouth-w: min(320px, 60vw);
    --mouth-h: min(70px, 12vh);

    /* 2. Define Triangle Shape */
    /* Higher value = Taller triangle (more isosceles, less equilateral) */
    /* User requested wider vertical spread (eyes higher, mouth lower) */
    --triangle-h: min(50vh, 550px);

    /* 3. Define Center Point */
    --center-y: 50vh;

    /* 4. Calculate Vertical Positions relative to Center Y */
    /* Eyes are shifted UP by half triangle height */
    --eye-top: calc(var(--center-y) - (var(--triangle-h) / 2) - (var(--eye-h) / 2));

    /* Mouth is shifted DOWN by half triangle height */
    --mouth-top: calc(var(--center-y) + (var(--triangle-h) / 2) - (var(--mouth-h) / 2));

    /* 5. Horizontal Spacing */
    --padding-x: 10vw;
}

/* -----------------------------
   BACKGROUND & LAYOUT
----------------------------- */
body {
    background: #6cc56c;
    overflow: hidden;
    width: 100vw;
    height: 100vh;
    margin: 0;
    position: fixed;
}

.inner-panel {
    width: 100%;
    height: 100%;
    position: relative;
    transition: margin-left 0.4s cubic-bezier(0.4, 0, 0.2, 1), width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Mobile: Overlay behavior (no shift) */
@media (min-width: 769px) {
    body.sidebar-open .inner-panel {
        margin-left: 280px;
        width: calc(100% - 280px);
    }
}

/* -----------------------------
   EYES (Top Inputs)
----------------------------- */
.top-inputs {
    position: absolute;
    /* Driven by center-based calculation */
    top: var(--eye-top);

    left: 0;
    width: 100%;
    display: flex;
    justify-content: space-between;
    padding: 0 var(--padding-x);

    /* Ensure z-index is managed if overlaps occur */
    z-index: 10;
}

.eye {
    position: relative;
    overflow: hidden;
    background: white;
    border: none;

    width: var(--eye-w);
    height: var(--eye-h);

    font-size: clamp(14px, 2vh, 22px);
    cursor: pointer;
    transition: all 0.3s ease;
}

.eye::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 0%;
    background: #6cc56c;
    z-index: 2;
    transition: height 0.25s ease-in-out;
}

.eye.blink::before {
    height: 100%;
}

.eye.left {
    color: red;
}

.eye.right {
    color: blue;
}

/* -----------------------------
   MOUTH (Explore Button)
----------------------------- */
.mouth {
    position: absolute;
    /* Driven by center-based calculation */
    top: var(--mouth-top);
    bottom: auto;
    /* Remove bottom anchor */

    left: 50%;
    transform: translateX(-50%);
    background: white;
    border: none;

    width: var(--mouth-w);
    height: var(--mouth-h);

    font-size: clamp(18px, 4vh, 32px);
    color: yellow;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 10;
}

/* -----------------------------
   NOSE (Chess Icon)
----------------------------- */
.nose {
    position: absolute;
    top: calc(var(--eye-top) + var(--eye-h) + (var(--mouth-top) - var(--eye-top) - var(--eye-h)) / 2);
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: clamp(30px, 6vh, 48px);
    color: #333;
    cursor: pointer;
    z-index: 15;
    transition: opacity 0.4s ease, transform 0.2s ease;
    user-select: none;
}

.nose.hidden {
    opacity: 0;
    pointer-events: none;
}

.nose:hover {
    transform: translate(-50%, -50%) scale(1.1);
    color: #000;
}

/* -----------------------------
   TEARS
----------------------------- */
.tears {
    position: absolute;
    /* 
     Tears hang below the eyes.
     Top = Eye Top + Eye Height + Gap
  */
    top: calc(var(--eye-top) + var(--eye-h) + 2vh);

    display: flex;
    flex-direction: column;
    gap: 2vh;
    z-index: 5;
}

/* 
   Centering Logic:
   Align with Eye Centers.
   Center X = Padding + Half Eye Width
*/
.tears.left {
    left: calc(var(--padding-x) + (var(--eye-w) / 2));
    transform: translateX(-50%);
}

.tears.right {
    right: calc(var(--padding-x) + (var(--eye-w) / 2));
    transform: translateX(50%);
}

.tear {
    width: min(29px, 5vmin);
    height: min(29px, 5vmin);
    background: #000;
    border: none;
    opacity: 0.4;
    animation: tearGlow 3.2s ease-in-out infinite;
    cursor: pointer;
}

.tears .tear:nth-child(1) {
    animation-delay: 0s;
}

.tears .tear:nth-child(2) {
    animation-delay: 0.6s;
}

.tears .tear:nth-child(3) {
    animation-delay: 1.2s;
}

.tears .tear:nth-child(4) {
    animation-delay: 1.8s;
}

@keyframes tearGlow {
    0% {
        opacity: 0.4;
        box-shadow: none;
    }

    30% {
        opacity: 0.9;
        box-shadow: 0 0 8px rgba(255, 255, 255, 0.35);
    }

    60% {
        opacity: 0.4;
        box-shadow: none;
    }

    100% {
        opacity: 0.4;
        box-shadow: none;
    }
}

/* -----------------------------
   YOUTUBE LINKS
----------------------------- */
.youtube-links {
    position: absolute;
    top: calc(var(--mouth-top) + var(--mouth-h) + 16px);
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 12px;
    z-index: 9;
}

.youtube-icon {
    width: 32px;
    height: 24px;
    background: red;
    /* Typical YouTube color, user can request changes */
    border-radius: 4px;
    cursor: pointer;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

/* Little play triangle for the icon */
.youtube-icon::after {
    content: "";
    width: 0;
    height: 0;
    border-top: 5px solid transparent;
    border-bottom: 5px solid transparent;
    border-left: 8px solid white;
}

.youtube-icon:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

/* -----------------------------
   PIXEL EFFECTS
----------------------------- */
.pixelate {
    filter: contrast(200%) saturate(80%);
    image-rendering: pixelated;
    transform: scale(1.02);
}

.pixel-clone {
    position: fixed;
    display: grid;
    pointer-events: none;
    z-index: 9999;
}

.pixel {
    background: currentColor;
    opacity: 1;
    transition: transform 0.6s ease, opacity 0.6s ease;
}

.screen-pixelate {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: inherit;
    pointer-events: none;
    z-index: 998;
    opacity: 0;
    filter: contrast(180%) saturate(90%);
    image-rendering: pixelated;
    transition: opacity 0.6s ease;
}