* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    color: #333;
}

.container {
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 600px;
    width: 100%;
    padding: 30px;
    position: relative;
    overflow: hidden;
}

/* Breadcrumb */
#breadcrumb {
    margin-bottom: 15px;
}

#breadcrumb a {
    color: #667eea;
    text-decoration: none;
    transition: all 0.2s;
}

#breadcrumb a:hover {
    text-decoration: underline;
    color: #764ba2;
}

/* Game Header */
.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #f0f0f0;
}

.back-button {
    background: rgba(255,255,255,0.9);
    border: 1px solid rgba(102, 126, 234, 0.3);
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    color: #667eea;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.2s;
    white-space: nowrap;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.back-button:hover {
    background: white;
    border-color: #667eea;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
    transform: translateY(-1px);
}

.header-right {
    display: flex;
    gap: 20px;
    align-items: center;
}

.lives-container {
    display: flex;
    align-items: center;
    gap: 10px;
}

.lives-label {
    font-weight: 600;
    color: #666;
}

.hearts {
    display: flex;
    gap: 5px;
}

.heart {
    font-size: 24px;
    transition: all 0.3s ease;
}

.heart.lost {
    opacity: 0.3;
    transform: scale(0.8);
}

.score-container {
    display: flex;
    align-items: center;
    gap: 10px;
}

.score-label {
    font-weight: 600;
    color: #666;
}

.score-value {
    font-size: 24px;
    font-weight: bold;
    color: #667eea;
}

/* Progress Bar */
.progress-bar {
    width: 100%;
    height: 8px;
    background: #f0f0f0;
    border-radius: 10px;
    margin-bottom: 10px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea, #764ba2);
    border-radius: 10px;
    transition: width 0.3s ease;
    width: 0%;
}

.progress-text {
    text-align: center;
    color: #666;
    font-size: 14px;
    margin-bottom: 30px;
}

/* Pictogram Container */
.pictogram-container {
    display: flex;
    justify-content: center;
    margin-bottom: 40px;
    min-height: 200px;
}

.pictogram-card {
    width: 200px;
    height: 280px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.3);
    transition: transform 0.3s ease;
    position: relative;
    overflow: hidden;
}

.pictogram-card img {
    max-width: 80%;
    max-height: 80%;
    object-fit: contain;
    filter: brightness(0) invert(1);
}

/* Answers Stack */
.answers-container {
    margin-bottom: 30px;
    min-height: 200px;
    display: flex;
    justify-content: center;
    align-items: center;
    perspective: 1000px;
}

.answers-stack {
    position: relative;
    width: 300px;
    height: 150px;
}

.answer-card {
    position: absolute;
    width: 100%;
    height: 100%;
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 15px;
    padding: 20px;
    font-size: 18px;
    font-weight: 500;
    color: #333;
    cursor: grab;
    transition: all 0.3s ease;
    user-select: none;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    backface-visibility: hidden;
}

.card-content {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 500;
}

.card-buttons {
    display: flex;
    gap: 20px;
    margin-top: 15px;
    justify-content: center;
    align-items: center;
}

.thumb-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: 3px solid transparent;
    background: white;
    font-size: 24px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    user-select: none;
}

.thumb-btn:hover {
    transform: scale(1.15);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

.thumb-btn:active {
    transform: scale(0.95);
}

.thumb-up {
    border-color: #27ae60;
}

.thumb-up:hover {
    background: #e8f8f0;
    border-color: #27ae60;
    box-shadow: 0 4px 15px rgba(39, 174, 96, 0.3);
}

.thumb-down {
    border-color: #e74c3c;
}

.thumb-down:hover {
    background: #fdeaea;
    border-color: #e74c3c;
    box-shadow: 0 4px 15px rgba(231, 76, 60, 0.3);
}

.answer-card:not(.top-card) .card-buttons {
    display: none;
}

.answer-card:active {
    cursor: grabbing;
}

.answer-card:not(.top-card) {
    transform: scale(0.95) translateY(5px);
    opacity: 0.7;
    pointer-events: none;
    z-index: 1;
}

.answer-card.top-card {
    z-index: 10;
    cursor: grab;
}

.answer-card.top-card:hover {
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
    border-color: #667eea;
}

.answer-card.swiping {
    pointer-events: none;
    z-index: 100;
    transition: none;
}

.answer-card.swipe-left {
    transform: translateX(-150%) rotate(-25deg) !important;
    opacity: 0;
    transition: all 0.4s ease;
}

.answer-card.swipe-right {
    transform: translateX(150%) rotate(25deg) !important;
    opacity: 0;
    transition: all 0.4s ease;
}

.answer-card.correct-action {
    border-color: #27ae60 !important;
    background: linear-gradient(135deg, #e8f8f0 0%, #d5f4e6 100%) !important;
    box-shadow: 0 4px 15px rgba(39, 174, 96, 0.3) !important;
}

.answer-card.correct-action .card-content,
.answer-card.correct-action.swipe-left .card-content,
.answer-card.correct-action.swipe-right .card-content {
    color: #27ae60 !important;
    font-weight: 600 !important;
}

/* Swipe Instructions */
.instructions {
    text-align: center;
    margin-top: 20px;
}

.swipe-hint {
    display: flex;
    justify-content: space-around;
    gap: 20px;
    font-size: 14px;
    color: #666;
}

.swipe-left {
    color: #e74c3c;
    font-weight: 600;
}

.swipe-right {
    color: #27ae60;
    font-weight: 600;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 20px;
    padding: 40px;
    text-align: center;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-content h2 {
    color: #667eea;
    margin-bottom: 20px;
    font-size: 32px;
}

.modal-content p {
    color: #666;
    margin-bottom: 15px;
    font-size: 18px;
}

.final-score {
    font-size: 24px;
    font-weight: bold;
    color: #667eea;
    margin: 20px 0;
}

.game-over-buttons {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 20px;
    align-items: center;
}

.btn-restart {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 15px 40px;
    border-radius: 25px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease;
    width: 100%;
    max-width: 300px;
}

.btn-restart:hover {
    transform: scale(1.05);
}

.btn-restart:active {
    transform: scale(0.95);
}

/* Celebration Container */
#celebrationContainer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 999;
}

/* Responsive Design */
@media (max-width: 600px) {
    .container {
        padding: 20px;
    }

    .game-header {
        flex-wrap: nowrap;
        gap: 10px;
    }
    
    .back-button {
        padding: 6px 12px;
        font-size: 11px;
        flex-shrink: 0;
        background: rgba(255,255,255,0.95);
        border: 1px solid rgba(102, 126, 234, 0.4);
    }
    
    .header-right {
        gap: 10px;
        flex: 1;
        justify-content: flex-end;
    }
    
    .lives-container {
        font-size: 14px;
    }
    
    .lives-label {
        font-size: 14px;
    }
    
    .score-container {
        font-size: 14px;
    }
    
    .score-label {
        font-size: 14px;
    }
    
    .score-value {
        font-size: 20px;
    }
    
    .heart {
        font-size: 20px;
    }

    .pictogram-card {
        width: 150px;
        height: 150px;
    }

    .answer-card {
        padding: 12px 20px;
        font-size: 14px;
        min-width: 100px;
    }

    .swipe-hint {
        flex-direction: column;
        gap: 10px;
    }
    
    #breadcrumb {
        font-size: 12px;
        padding: 8px 15px;
        margin: 5px 10px;
    }
}

/* Swipe Feedback */
.swipe-feedback {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 48px;
    font-weight: bold;
    z-index: 500;
    pointer-events: auto; /* Allow clicking the sound button */
    animation: feedbackPulse 0.5s ease;
    padding: 20px 30px;
    background: rgba(0, 0, 0, 0.85);
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

@keyframes feedbackPulse {
    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: 0;
    }
}

.swipe-feedback.correct {
    color: #27ae60;
}

.swipe-feedback.incorrect {
    color: #e74c3c;
}

