/* ========== OVERLAY STYLES ========== */
/* Success, penalty, and photo viewer overlays */

/* ========== PHOTO VIEWER OVERLAY ========== */

.photo-viewer {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: black;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    padding: 0;
    padding-top: env(safe-area-inset-top, 0);
    padding-bottom: env(safe-area-inset-bottom, 0);
    box-sizing: border-box;
    overflow: hidden;
}

.photo-viewer.hidden {
    display: none;
}

.photo-viewer-header {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px;
    z-index: 10;
    background: linear-gradient(to bottom, rgba(0,0,0,0.6), transparent);
}

.photo-viewer-header h3 {
    color: var(--white);
    margin: 0;
    font-size: 0.9rem;
    padding-left: 8px;
}

.photo-viewer-close {
    background: none;
    border: none;
    color: var(--white);
    font-size: 2.5rem;
    cursor: pointer;
    padding: 0 12px;
    line-height: 1;
}

.photo-viewer-image {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    min-height: 0;
    overflow: hidden;
    width: 100%;
    height: 100%;
}

.photo-viewer-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.photo-viewer-hint {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    color: white;
    text-align: center;
    padding: 12px;
    font-size: 0.85rem;
    background: linear-gradient(to top, rgba(0,0,0,0.6), transparent);
}

@media (orientation: landscape) {
    .photo-viewer-header h3 {
        display: none;
    }

    .photo-viewer-hint {
        display: none;
    }
}

/* ========== SUCCESS OVERLAY ========== */

.success-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(26, 71, 42, 0.95);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    opacity: 1;
    visibility: visible;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.success-overlay.hidden {
    display: flex !important;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.success-content {
    text-align: center;
    animation: successPop 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes successPop {
    0% {
        transform: scale(0.5);
        opacity: 0;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.success-icon {
    font-size: 5rem;
    width: 120px;
    height: 120px;
    line-height: 120px;
    background: var(--white);
    color: var(--secondary);
    border-radius: 50%;
    margin: 0 auto 24px;
    font-weight: bold;
}

.success-message {
    font-size: 2rem;
    font-weight: 600;
    margin: 0 0 16px;
}

.success-next {
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.3s ease;
    text-align: center;
}

.success-next.visible {
    visibility: visible;
    opacity: 1;
}

.success-countdown {
    font-size: 1.1rem;
    margin: 0;
    opacity: 0.9;
}

.success-countdown #countdown-number {
    font-weight: bold;
    font-size: 1.3rem;
}

.btn-skip {
    display: block;
    margin: 24px auto 0;
    background: transparent;
    border: 2px solid rgba(255, 255, 255, 0.6);
    color: white;
    padding: 10px 32px;
    font-size: 1rem;
    border-radius: 100px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.btn-skip:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: white;
}

/* ========== PENALTY OVERLAY ========== */

.penalty-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(196, 30, 58, 0.95);
    z-index: 2000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: safe center;
    color: var(--white);
    overflow-y: auto;
    padding: 16px;
    box-sizing: border-box;
    opacity: 1;
    visibility: visible;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.penalty-overlay.hidden {
    display: flex !important;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.penalty-timer-group {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.penalty-timer {
    font-size: 4rem;
    font-weight: bold;
    margin: 16px 0;
}

.penalty-message {
    font-size: 1.2rem;
    text-align: center;
    padding: 0 16px;
}

.penalty-question {
    margin-top: 20px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0 16px;
    width: 100%;
    box-sizing: border-box;
}

.penalty-hint {
    opacity: 0.9;
}

.penalty-question-label {
    font-size: 1.1rem;
    font-weight: bold;
    margin-bottom: 16px;
}

.penalty-choices {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
    max-width: 280px;
}

.penalty-choice-btn {
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid white;
    color: white;
    padding: 12px 20px;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    width: 100%;
    transition: background 0.2s, transform 0.1s;
}

.penalty-choice-btn:active {
    transform: scale(0.98);
}

.penalty-choice-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

.penalty-choice-btn.correct {
    background: var(--secondary);
    border-color: var(--secondary);
}

.penalty-choice-btn.wrong {
    background: rgba(0, 0, 0, 0.3);
    border-color: rgba(255, 255, 255, 0.3);
}

.penalty-continue {
    margin-top: 24px;
    text-align: center;
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.penalty-continue.visible {
    visibility: visible;
    opacity: 1;
}

#penalty-continue-btn {
    background: white;
    color: var(--secondary);
    font-weight: 700;
    padding: 14px 32px;
    font-size: 1.1rem;
}

/* Landscape mode - side by side layout */
@media (orientation: landscape) and (max-height: 500px) {
    .penalty-overlay {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        align-items: flex-start;
        gap: 24px;
        padding: 12px 24px;
    }

    .penalty-overlay .penalty-message:first-child {
        width: 100%;
    }

    .penalty-overlay .penalty-timer {
        font-size: 3rem;
        margin: 0;
    }

    .penalty-overlay .penalty-message#penalty-wait-msg {
        font-size: 1.2rem;
        margin: 0;
        padding: 0;
    }

    .penalty-overlay .penalty-question {
        margin-top: 0;
        max-width: 280px;
    }
}

@media (min-width: 768px) {
    .penalty-choices {
        max-width: 350px;
    }
}
