* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
html, body {
    height: 100%;
    width: 100%;
    overflow: hidden;
    background-color: black;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    transition: background 0.6s ease;
    user-select: none;
    -webkit-user-select: none;
}
body {
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}
/* Party Mode Background Animation */
body.party-mode {
    animation: discoBg 2.5s infinite alternate ease-in-out;
}
@keyframes discoBg {
    0%   { background-color: #1a0826; }
    25%  { background-color: #0d1e38; }
    50%  { background-color: #062b1b; }
    75%  { background-color: #381f08; }
    100% { background-color: #33081a; }
}
/* Photo Stage & Container */
.stage {
    position: relative;
    max-width: 100vw;
    max-height: 100vh;
    aspect-ratio: 1287 / 1512;
    display: flex;
    justify-content: center;
    align-items: center;
}
.main-photo {
    position: relative;
    z-index: 10;
    width: 100%;
    height: 100%;
    object-fit: contain;
    border: 1px solid darkgrey;
    display: block;
    pointer-events: auto;
    transition: transform 0.12s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    -webkit-user-drag: none;
}
.main-photo.boop-squish {
    transform: scale(0.99);
}
/* Nose Boop Hotspot */
.snoot-hotspot {
    position: absolute;
    left: 44.5%;
    top: 29.5%;
    width: 19%;
    height: 11.5%;
    border-radius: 45% 45% 55% 55%;
    cursor: pointer;
    z-index: 20;
    background: transparent;
    -webkit-tap-highlight-color: transparent;
}
/* Realistic Eyeball Sockets Behind Photo (Active by Default) */
.eyeball-socket {
    position: absolute;
    z-index: 5;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    pointer-events: none;
    background: transparent;
    box-shadow: none;
}
#socket-left {
    left: 40.2%;
    top: 21.8%;
    width: 8.4%;
    height: 4.3%;
    border-radius: 48% 52% 46% 54% / 50% 50% 45% 55%;
    transform: rotate(2deg);

    background: radial-gradient(
        ellipse at 50% 55%,
        #685350 0%,
        #503e3c 65%,
        #302221 100%
    );
}
#socket-right {
    left: 65.0%;
    top: 21.8%;
    width: 8.0%;
    height: 4.0%;
    border-radius: 50% 50% 45% 45% / 60% 60% 40% 40%;
    transform: rotate(1deg);
    background: radial-gradient(ellipse at 50% 60%, #7c6460 0%, #5e4a47 60%, #382827 100%);
}
.eyeball-socket .iris {
    position: absolute;
    width: 53%;
    aspect-ratio: 1;
    border-radius: 50%;
    background: radial-gradient(circle at 45% 42%, #38362b 0%, #2b2b20 28%, #1f1e16 58%, #13120d 84%, #060504 100%);
    box-shadow: 0 0 3px rgba(0,0,0,0.9), inset 0 0 2px rgba(0,0,0,0.95);
    display: flex;
    justify-content: center;
    align-items: center;
    will-change: transform;
    transition: transform 0.35s cubic-bezier(0.25, 1, 0.5, 1);
}
.stage.tracking-active .eyeball-socket .iris {
    transition: transform 0.04s ease-out;
}
.eyeball-socket .pupil {
    position: relative;
    width: 44%;
    height: 44%;
    background: #030303;
    border-radius: 50%;
    box-shadow: inset 0 0 2px rgba(0,0,0,1);
}
.eyeball-socket .glint-primary {
    position: absolute;
    width: 24%;
    height: 24%;
    background: rgba(240, 235, 225, 0.65);
    border-radius: 50%;
    top: 16%;
    left: 18%;
    filter: drop-shadow(0 0 1px rgba(255,255,255,0.4));
}
.eyeball-socket .glint-secondary {
    position: absolute;
    width: 14%;
    height: 14%;
    background: rgba(230, 220, 210, 0.35);
    border-radius: 50%;
    bottom: 22%;
    right: 22%;
}
/* Googly Eyes Layer (Alternative Fun Mode) */
.googly-eye {
    position: absolute;
    width: 9.6%;
    aspect-ratio: 1;
    background: #ffffff;
    border-radius: 50%;
    border: 2.5px solid #111111;
    box-shadow: inset 0 2px 5px rgba(0,0,0,0.35), 0 4px 10px rgba(0,0,0,0.6);
    z-index: 25;
    display: none;
    overflow: hidden;
    pointer-events: none;
    transform-origin: center center;
}
.googly-eye.active {
    display: block;
    animation: eyePopIn 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.4);
}
#eye-left {
    left: 39.6%;
    top: 19.7%;
    transform: rotate(2deg);
}
#eye-right {
    left: 64.2%;
    top: 19.8%;
    transform: rotate(1deg);
}
.eye-pupil {
    position: absolute;
    width: 56%;
    height: 56%;
    background: #111111;
    border-radius: 50%;
    top: 22%;
    left: 22%;
    box-shadow: inset 1px 1px 2px rgba(255,255,255,0.25);
    transition: transform 0.04s ease-out;
}
.eye-glint {
    position: absolute;
    width: 28%;
    height: 28%;
    background: rgba(255,255,255,0.9);
    border-radius: 50%;
    top: 15%;
    right: 18%;
}
@keyframes eyePopIn {
    0%   { transform: scale(0) rotate(-45deg); opacity: 0; }
    80%  { transform: scale(1.15) rotate(10deg); opacity: 1; }
    100% { transform: scale(1) rotate(0deg); opacity: 1; }
}
/* Sunglasses Layer (Deal With It) */
.sunglasses-container {
    position: absolute;
    top: 18.5%;
    left: 32.7%;
    width: 48%;
    z-index: 30;
    pointer-events: none;
    display: none;
    transform-origin: center center;
}
.sunglasses-container.active {
    display: block;
    animation: dropShades 0.85s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
.sunglasses-svg {
    width: 100%;
    height: auto;
    filter: drop-shadow(0 8px 16px rgba(0,0,0,0.8));
}
@keyframes dropShades {
    0% {
        transform: translateY(-800%) rotate(-18deg);
        opacity: 0;
    }
    60% {
        opacity: 1;
    }
    100% {
        transform: translateY(0) rotate(-2.5deg);
        opacity: 1;
    }
}
/* Floating Particle Emojis */
.floating-particle {
    position: fixed;
    pointer-events: none;
    z-index: 100;
    font-size: 2rem;
    will-change: transform, opacity;
    animation: floatUpAndFade 1.2s cubic-bezier(0.1, 0.8, 0.3, 1) forwards;
}
@keyframes floatUpAndFade {
    0% {
        transform: translate(0, 0) scale(0.6) rotate(0deg);
        opacity: 1;
    }
    50% {
        transform: translate(var(--dx), calc(var(--dy) * 0.6)) scale(1.3) rotate(var(--rot));
        opacity: 0.9;
    }
    100% {
        transform: translate(calc(var(--dx) * 1.5), var(--dy)) scale(0.9) rotate(calc(var(--rot) * 2));
        opacity: 0;
    }
}
/* Boop Floating Badge Text */
.boop-badge {
    position: fixed;
    pointer-events: none;
    z-index: 101;
    font-weight: 900;
    font-size: 1.15rem;
    color: #ffeb3b;
    text-shadow: 0 2px 4px rgba(0,0,0,0.8), 0 0 10px rgba(255, 235, 59, 0.6);
    letter-spacing: 1px;
    animation: badgeFloat 1s cubic-bezier(0.18, 0.89, 0.32, 1.28) forwards;
}
@keyframes badgeFloat {
    0% {
        transform: translate(-50%, 0) scale(0.5);
        opacity: 0;
    }
    25% {
        transform: translate(-50%, -20px) scale(1.15);
        opacity: 1;
    }
    100% {
        transform: translate(-50%, -60px) scale(0.95);
        opacity: 0;
    }
}
/* Party Mode Banner */
.party-banner {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: #fff;
    border: 2px solid #ff007f;
    box-shadow: 0 0 20px rgba(255, 0, 127, 0.5), inset 0 0 10px rgba(0, 240, 255, 0.3);
    padding: 10px 24px;
    border-radius: 30px;
    font-weight: bold;
    font-size: 0.95rem;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    z-index: 200;
    display: none;
    text-align: center;
    animation: pulseGlow 1.5s infinite alternate;
}
.party-banner.active {
    display: block;
}
@keyframes pulseGlow {
    0% { box-shadow: 0 0 12px rgba(255, 0, 127, 0.4); }
    100% { box-shadow: 0 0 26px rgba(0, 240, 255, 0.8); }
}
/* Fullscreen Canvas for Confetti */
#fx-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 90;
}
/* Metrics Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 500;
    opacity: 0;
    transition: opacity 0.3s ease;
}
.modal-overlay.active {
    display: flex;
    opacity: 1;
}
.modal-content {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border: 2px solid #00d4ff;
    border-radius: 12px;
    padding: 24px;
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 8px 32px rgba(0, 212, 255, 0.3), inset 0 0 20px rgba(0, 212, 255, 0.1);
    color: #fff;
    font-family: monospace;
}
.modal-content h2 {
    color: #00d4ff;
    margin-bottom: 16px;
    font-size: 1.4rem;
    text-shadow: 0 0 10px rgba(0, 212, 255, 0.6);
}
.modal-content h3 {
    color: #ffeb3b;
    margin-top: 16px;
    margin-bottom: 8px;
    font-size: 1rem;
}
.metric-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid rgba(0, 212, 255, 0.2);
}
.metric-label {
    color: #aaa;
}
.metric-value {
    color: #00ff88;
    font-weight: bold;
}
.feature-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin: 12px 0;
}
.feature-box {
    background: rgba(0, 212, 255, 0.1);
    border: 1px solid rgba(0, 212, 255, 0.3);
    border-radius: 6px;
    padding: 12px;
    text-align: center;
}
.feature-name {
    color: #aaa;
    font-size: 0.85rem;
    margin-bottom: 4px;
}
.feature-count {
    color: #00ff88;
    font-size: 1.3rem;
    font-weight: bold;
}
.modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    background: none;
    border: none;
    color: #00d4ff;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 4px 8px;
    transition: color 0.2s;
}
.modal-close:hover {
    color: #ffeb3b;
}
.metrics-toggle {
    position: fixed;
    right: 24px;
    background: rgba(0, 212, 255, 0.15);
    border: 1px solid rgba(0, 212, 255, 0.5);
    color: #00d4ff;
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85rem;
    z-index: 250;
    transition: all 0.2s ease;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-weight: 500;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
}
#metrics-toggle {
    top: 24px;
}
#credits-toggle {
    top: 64px;
}
.metrics-toggle:hover {
    background: rgba(0, 212, 255, 0.25);
    border-color: #00d4ff;
    box-shadow: 0 0 12px rgba(0, 212, 255, 0.4);
}
.metrics-toggle:active {
    transform: scale(0.95);
}
.loading {
    color: #ffeb3b;
    text-align: center;
    padding: 20px;
}
.error {
    color: #ff6b6b;
    text-align: center;
    padding: 20px;
}
