/* Catch Me If You Can - Game Styles */

/* Profile image tooltip bubble */
.game-tooltip {
    position: absolute;
    bottom: -75px;
    left: 45%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.9);
    color: #f8fafc;
    padding: 12px 18px;
    border-radius: 25px;
    font-size: 14px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    white-space: nowrap;
    opacity: 1;
    visibility: visible;
    transition: all 0.3s ease;
    z-index: 10;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    max-width: 250px;
    white-space: normal;
    text-align: center;
    line-height: 1.4;
    animation: tooltipPulse 2s ease-in-out infinite;
}

.game-tooltip::before {
    content: '';
    position: absolute;
    top: -10px;
    left: 60%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-bottom: 10px solid rgba(0, 0, 0, 0.9);
}

.game-tooltip::after {
    content: '';
    position: absolute;
    top: -11px;
    left: 60%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 11px solid transparent;
    border-right: 11px solid transparent;
    border-bottom: 11px solid rgba(255, 255, 255, 0.1);
}

.profile-image:hover .game-tooltip {
    animation: tooltipBounce 0.5s ease-out, tooltipPulse 2s ease-in-out infinite;
}

@keyframes tooltipBounce {
    0% {
        opacity: 0;
        transform: translateX(-50%) translateY(10px);
    }
    60% {
        transform: translateX(-50%) translateY(-3px);
    }
    100% {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

/* Level up notification animation */
@keyframes levelUpPulse {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.8);
    }
    20% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1.1);
    }
    40% {
        transform: translate(-50%, -50%) scale(1);
    }
    90% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
    100% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.9);
    }
}

/* Tooltip pulse animation to draw attention */
@keyframes tooltipPulse {
    0%, 100% {
        opacity: 1;
        transform: translateX(-50%) scale(1);
    }
    50% {
        opacity: 0.7;
        transform: translateX(-50%) scale(1.05);
    }
}

/* Pokemon caught notification animation */
@keyframes pokemonCaughtFade {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.8);
    }
    15% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1.1);
    }
    25% {
        transform: translate(-50%, -50%) scale(1);
    }
    85% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
    100% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.9);
    }
}

/* Bounce animation for profile image */
@keyframes profileBounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-15px);
    }
    60% {
        transform: translateY(-8px);
    }
}

/* Rotation animation for moving target */
@keyframes targetRotate {
    0% {
        transform: rotate(0deg) scale(1);
    }
    25% {
        transform: rotate(90deg) scale(1.05);
    }
    50% {
        transform: rotate(180deg) scale(1);
    }
    75% {
        transform: rotate(270deg) scale(1.05);
    }
    100% {
        transform: rotate(360deg) scale(1);
    }
}

/* Trophy rotation animation (slower, steady) */
@keyframes trophyRotate {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

.profile-bouncing {
    animation: profileBounce 0.6s ease-in-out;
}

/* Game overlay */
.catch-me-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    z-index: 9999;
    display: none;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.catch-me-overlay.active {
    display: flex;
    opacity: 1;
    align-items: center;
    justify-content: center;
}

/* Game container */
.catch-me-game {
    position: relative;
    width: 100%;
    height: 100%;
    cursor: crosshair;
}

/* Moving profile clone */
.catch-me-target {
    position: absolute;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.5s cubic-bezier(0.25, 0.8, 0.25, 1);
    z-index: 10000;
    box-shadow: 0 8px 32px rgba(255, 255, 255, 0.1);
    border: 3px solid rgba(255, 255, 255, 0.2);
    transform: scale(1);
    object-fit: cover;
}

/* Caught target trophy styling */
.catch-me-trophy {
    position: absolute;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    cursor: default !important;
    z-index: 9999; /* Lower than active target */
    object-fit: cover;
    pointer-events: none !important;
    user-select: none;
    transition: opacity 0.3s ease;
}

.catch-me-target:hover {
    animation-duration: 1.5s;
    box-shadow: 0 12px 40px rgba(255, 255, 255, 0.2);
}

.catch-me-target:active {
    animation-duration: 0.3s;
}

/* Win overlay modal */
.catch-me-win {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(20px);
    color: #f8fafc;
    padding: 40px;
    border-radius: 20px;
    text-align: center;
    max-width: 400px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    border: 2px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    z-index: 10002;
}

.catch-me-win h2 {
    margin: 0 0 20px 0;
    font-size: 28px;
    font-weight: 600;
    color: #fff;
}

.catch-me-win p {
    margin: 0 0 30px 0;
    font-size: 16px;
    color: #e2e8f0;
    line-height: 1.6;
}

/* CSS Pokeball */
.pokeball {
    width: 90px;
    height: 90px;
    background: linear-gradient(to bottom, #ff1744 0%, #ff1744 50%, #ffffff 50%, #ffffff 100%);
    border-radius: 50%;
    margin: 20px auto;
    position: relative;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    border: 3px solid #000;
}

/* Pokeball center line */
.pokeball::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 6px;
    background: #000;
    transform: translateY(-50%);
}

/* Pokeball center button */
.pokeball::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 24px;
    height: 24px;
    background: radial-gradient(circle, #ffffff 0%, #ffffff 40%, #000 42%, #000 58%, #cccccc 60%, #cccccc 100%);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* CSS Pokedex for level 5 completion */
.pokedex {
    width: 120px;
    height: 140px;
    margin: 20px auto;
    position: relative;
    background: linear-gradient(145deg, #ff4444 0%, #cc0000 100%);
    border-radius: 15px;
    border: 3px solid #000;
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.4);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 10px;
}

/* Pokedex screen */
.pokedex::before {
    content: '';
    width: 80px;
    height: 50px;
    background: linear-gradient(145deg, #333 0%, #000 100%);
    border-radius: 8px;
    border: 2px solid #666;
    margin: 5px 0;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.5);
}

/* Pokedex buttons */
.pokedex::after {
    content: '';
    position: absolute;
    bottom: 15px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 20px;
    background: repeating-linear-gradient(
        90deg,
        #ffff00 0px,
        #ffff00 8px,
        #000 8px,
        #000 10px,
        #00ff00 10px,
        #00ff00 18px,
        #000 18px,
        #000 20px
    );
    border-radius: 10px;
    border: 1px solid #333;
}

/* Pokedex light indicator */
.pokedex-light {
    position: absolute;
    top: 8px;
    right: 15px;
    width: 12px;
    height: 12px;
    background: radial-gradient(circle, #00ff00 0%, #00aa00 100%);
    border-radius: 50%;
    border: 1px solid #333;
    box-shadow: 0 0 8px rgba(0, 255, 0, 0.6);
}

/* Pokemon grid inside Pokedex */
.pokedex-grid {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: 76px;
    height: 46px;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    grid-template-rows: repeat(3, 1fr);
    gap: 1px;
    background: #111;
    border-radius: 6px;
    padding: 2px;
}

.pokemon-mini {
    width: 14px;
    height: 14px;
    background-size: cover;
    background-position: center;
    border-radius: 2px;
    opacity: 0.8;
}

/* Action buttons */
.catch-me-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 30px;
}

.catch-me-btn {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    border: 2px solid rgba(255, 255, 255, 0.3);
    padding: 12px 24px;
    border-radius: 30px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    outline: none;
}

.catch-me-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(255, 255, 255, 0.1);
}

.catch-me-btn:active {
    transform: translateY(0);
}

.catch-me-btn.primary {
    background: rgba(255, 255, 255, 0.9);
    color: #000000;
    border-color: rgba(255, 255, 255, 1);
}

.catch-me-btn.primary:hover {
    background: rgba(255, 255, 255, 1);
    box-shadow: 0 8px 25px rgba(255, 255, 255, 0.2);
}

/* Game state indicators */
.catch-me-instructions {
    position: absolute;
    top: 30px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: #f8fafc;
    padding: 15px 25px;
    border-radius: 25px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 16px;
    font-weight: 500;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 10001;
    text-align: center;
    display: flex;
    align-items: center;
    gap: 20px;
}

/* Exit button */
.catch-me-exit {
    background: rgba(255, 255, 255, 0.1);
    color: #f8fafc;
    border: 2px solid rgba(255, 255, 255, 0.2);
    padding: 8px 16px;
    border-radius: 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    outline: none;
    flex-shrink: 0;
}

.catch-me-exit:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.4);
    transform: translateY(-1px);
}

.catch-me-exit:focus {
    outline: 2px solid rgba(59, 130, 246, 0.8);
    outline-offset: 2px;
}

/* Scorecard */
.catch-me-scorecard {
    position: absolute;
    top: 30px;
    right: 30px;
    background: rgba(0, 0, 0, 0.8);
    color: #f8fafc;
    padding: 15px 20px;
    border-radius: 15px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 14px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 10001;
    min-width: 150px;
}

.score-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.score-item:last-child {
    margin-bottom: 0;
}

.score-label {
    font-weight: 500;
    opacity: 0.8;
}

.score-value {
    font-weight: 600;
    color: #ffffff;
}

/* Responsive design */
@media (max-width: 768px) {
    .catch-me-target {
        width: 100px;
        height: 100px;
    }
    
    .catch-me-trophy {
        width: 100px;
        height: 100px;
    }
    
    .catch-me-win {
        padding: 30px 20px;
        margin: 20px;
    }
    
    .catch-me-win h2 {
        font-size: 24px;
    }
    
    .pokeball {
        width: 70px;
        height: 70px;
    }
    
    .pokeball::after {
        width: 20px;
        height: 20px;
    }
    
    .pokedex {
        width: 100px;
        height: 120px;
    }
    
    .pokedex::before {
        width: 70px;
        height: 40px;
    }
    
    .pokedex-grid {
        width: 66px;
        height: 36px;
    }
    
    .pokemon-mini {
        width: 12px;
        height: 12px;
    }
    
    .game-tooltip {
        font-size: 12px;
        padding: 8px 14px;
        bottom: -55px;
        left: 40%;
        max-width: 200px;
    }
    
    .game-tooltip::before {
        left: 65%;
    }
    
    .game-tooltip::after {
        left: 65%;
    }
    
    .catch-me-instructions {
        font-size: 14px;
        padding: 12px 20px;
        top: 20px;
        max-width: 95%;
        flex-direction: column;
        gap: 10px;
    }
    
    .catch-me-exit {
        padding: 6px 14px;
        font-size: 13px;
    }
    
    .catch-me-scorecard {
        top: 15px;
        right: 15px;
        padding: 12px 15px;
        font-size: 13px;
        min-width: 130px;
    }
}

/* Accessibility improvements */
@media (prefers-reduced-motion: reduce) {
    .catch-me-target,
    .profile-bouncing,
    .catch-me-overlay,
    .catch-me-btn,
    .game-tooltip {
        transition: none;
        animation: none;
    }
    
    .catch-me-target {
        animation: none;
    }
}

/* Focus styles for keyboard navigation */
.catch-me-btn:focus {
    outline: 2px solid rgba(59, 130, 246, 0.8);
    outline-offset: 2px;
}

.catch-me-target:focus {
    outline: 3px solid rgba(59, 130, 246, 0.8);
    outline-offset: 3px;
}

/* End Game Modal Styles */
.catch-me-end-game {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(20px);
    color: #f8fafc;
    padding: 40px;
    border-radius: 20px;
    text-align: center;
    max-width: 500px;
    width: 90%;
    border: 2px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    z-index: 10003;
}

.catch-me-end-game h2 {
    margin: 0 0 20px 0;
    font-size: 32px;
    font-weight: 600;
    color: #ffffff;
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.3);
}

.catch-me-end-game p {
    margin: 0 0 15px 0;
    font-size: 16px;
    color: #e2e8f0;
    line-height: 1.6;
}

.end-game-actions {
    position: relative;
    height: 80px;
    margin-top: 30px;
}

/* Simplified moving button animation */
.moving-no {
    position: relative !important;
    transition: all 0.3s ease !important;
}

.moving-no:hover {
    transform: scale(1.05);
    background: rgba(239, 68, 68, 0.1);
    border-color: #f59e0b;
    color: #f59e0b;
}

/* Simple bounce animation for playful movement */
@keyframes playfulBounce {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-5px);
    }
}

.moving-no.bouncing {
    animation: playfulBounce 0.5s ease-in-out;
}

/* Celebration emoji bounce animation */
@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-20px);
    }
    60% {
        transform: translateY(-10px);
    }
}