/* TANZ-POSEN - Game-specific Styles */

/* Game Container Background */
.game-container {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
}

/* Pose Match Indicator */
.pose-match-indicator {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    opacity: 0;
    pointer-events: none;
    z-index: 100;
    transition: opacity 0.3s ease;
}

.pose-match-indicator.visible {
    opacity: 1;
    animation: poseMatchPop 0.5s ease-out;
}

.pose-match-stars {
    font-size: 3rem;
    text-shadow: 0 0 20px rgba(255, 215, 0, 0.8);
    animation: starsPulse 0.5s ease-in-out;
}

.pose-match-text {
    font-size: 2rem;
    font-weight: bold;
    color: #fff;
    text-shadow:
        0 0 10px rgba(255, 255, 255, 0.8),
        0 0 20px rgba(255, 215, 0, 0.6),
        2px 2px 4px rgba(0, 0, 0, 0.5);
    margin-top: 10px;
}

@keyframes poseMatchPop {
    0% {
        transform: translate(-50%, -50%) scale(0.5);
        opacity: 0;
    }
    50% {
        transform: translate(-50%, -50%) scale(1.2);
        opacity: 1;
    }
    100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
}

@keyframes starsPulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

/* Progress Bar Container */
.pose-progress-bar {
    position: fixed;
    bottom: 120px;
    left: 50%;
    transform: translateX(-50%);
    width: 60%;
    max-width: 400px;
    height: 20px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 10px;
    overflow: hidden;
    border: 2px solid rgba(255, 255, 255, 0.3);
    z-index: 50;
}

.pose-progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #4CAF50, #8BC34A, #CDDC39);
    border-radius: 8px;
    transition: width 0.1s ease-out;
    box-shadow: 0 0 10px rgba(76, 175, 80, 0.5);
}

.pose-progress-fill.matched {
    background: linear-gradient(90deg, #FFD700, #FFA500, #FF6347);
    animation: progressGlow 0.5s ease-in-out infinite alternate;
}

@keyframes progressGlow {
    from {
        box-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
    }
    to {
        box-shadow: 0 0 20px rgba(255, 215, 0, 0.8);
    }
}

/* Pose Name Display */
.pose-name-display {
    position: fixed;
    bottom: 150px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 1.5rem;
    font-weight: bold;
    color: #fff;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    z-index: 50;
    text-align: center;
}

/* Avatar Panel (left side) */
.avatar-panel {
    position: fixed;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    width: 200px;
    height: 300px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(10px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 40;
}

.avatar-panel-title {
    position: absolute;
    top: 10px;
    font-size: 0.9rem;
    font-weight: bold;
    color: rgba(255, 255, 255, 0.9);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Player Panel (right side) */
.player-panel {
    position: fixed;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    width: 200px;
    height: 300px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(10px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 40;
}

.player-panel-title {
    position: absolute;
    top: 10px;
    font-size: 0.9rem;
    font-weight: bold;
    color: rgba(255, 255, 255, 0.9);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Match percentage indicator */
.match-percentage {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 2rem;
    font-weight: bold;
    color: #fff;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    z-index: 50;
}

.match-percentage.good {
    color: #4CAF50;
}

.match-percentage.great {
    color: #FFD700;
}

.match-percentage.perfect {
    color: #FF6347;
    animation: perfectPulse 0.5s ease-in-out infinite alternate;
}

@keyframes perfectPulse {
    from {
        transform: translateX(-50%) scale(1);
    }
    to {
        transform: translateX(-50%) scale(1.1);
    }
}

/* Music visualization */
.music-visualizer {
    position: fixed;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 4px;
    z-index: 30;
}

.music-bar {
    width: 6px;
    height: 20px;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 3px;
    animation: musicBounce 0.5s ease-in-out infinite;
}

.music-bar:nth-child(1) { animation-delay: 0s; }
.music-bar:nth-child(2) { animation-delay: 0.1s; }
.music-bar:nth-child(3) { animation-delay: 0.2s; }
.music-bar:nth-child(4) { animation-delay: 0.3s; }
.music-bar:nth-child(5) { animation-delay: 0.4s; }

@keyframes musicBounce {
    0%, 100% {
        height: 10px;
    }
    50% {
        height: 30px;
    }
}

/* Countdown overlay */
.countdown-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.5);
    z-index: 200;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.countdown-overlay.visible {
    opacity: 1;
    pointer-events: auto;
}

.countdown-number {
    font-size: 10rem;
    font-weight: bold;
    color: #fff;
    text-shadow:
        0 0 20px rgba(255, 255, 255, 0.8),
        0 0 40px rgba(156, 39, 176, 0.6);
    animation: countdownPop 1s ease-out;
}

@keyframes countdownPop {
    0% {
        transform: scale(2);
        opacity: 0;
    }
    50% {
        transform: scale(1);
        opacity: 1;
    }
    100% {
        transform: scale(0.8);
        opacity: 0;
    }
}

/* Mobile adjustments */
@media (max-width: 768px) {
    .avatar-panel,
    .player-panel {
        width: 120px;
        height: 180px;
    }

    .avatar-panel {
        left: 10px;
    }

    .player-panel {
        right: 10px;
    }

    .pose-progress-bar {
        width: 80%;
        bottom: 100px;
    }

    .pose-name-display {
        font-size: 1.2rem;
        bottom: 130px;
    }

    .match-percentage {
        font-size: 1.5rem;
        bottom: 60px;
    }
}

/* Portrait mode warning */
@media (max-height: 500px) and (orientation: landscape) {
    .avatar-panel,
    .player-panel {
        width: 100px;
        height: 150px;
    }
}

/* ==================== AVATAR SELECTION ==================== */

.avatar-selection-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 300;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.avatar-selection-overlay.visible {
    opacity: 1;
    pointer-events: auto;
}

.avatar-selection-content {
    text-align: center;
    padding: 30px;
}

.avatar-selection-title {
    font-size: 2.5rem;
    color: #fff;
    margin-bottom: 30px;
    text-shadow: 0 0 20px rgba(156, 39, 176, 0.8);
    animation: titlePulse 2s ease-in-out infinite;
}

@keyframes titlePulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.avatar-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
    max-width: 600px;
    margin: 0 auto 20px;
}

.avatar-option {
    width: 120px;
    height: 150px;
    background: rgba(255, 255, 255, 0.1);
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 15px;
}

.avatar-option:hover {
    background: rgba(156, 39, 176, 0.3);
    border-color: rgba(156, 39, 176, 0.8);
    transform: scale(1.1);
}

.avatar-option.selected {
    background: rgba(156, 39, 176, 0.5);
    border-color: #9C27B0;
    box-shadow: 0 0 20px rgba(156, 39, 176, 0.6);
}

.avatar-option-emoji {
    font-size: 3rem;
    margin-bottom: 10px;
}

.avatar-option-name {
    font-size: 1rem;
    color: #fff;
    font-weight: bold;
}

.avatar-option-desc {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.7);
    margin-top: 5px;
}

.avatar-selection-hint {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.9rem;
    margin-top: 20px;
}

/* Mobile adjustments for avatar selection */
@media (max-width: 500px) {
    .avatar-selection-title {
        font-size: 1.8rem;
    }

    .avatar-option {
        width: 100px;
        height: 130px;
    }

    .avatar-option-emoji {
        font-size: 2.5rem;
    }

    .avatar-option-name {
        font-size: 0.9rem;
    }
}