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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #c92a2a;
    min-height: 100vh;
    padding: 20px;
    color: #333;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

header {
    text-align: center;
    color: white;
    margin-bottom: 40px;
    padding: 30px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

header h1 {
    font-size: 3em;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.subtitle {
    font-size: 1.2em;
    opacity: 0.9;
}

.btn-test-mode {
    margin-top: 15px;
    padding: 10px 20px;
    font-size: 0.9em;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 2px solid white;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: bold;
}

.btn-test-mode:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

.btn-test-mode.active {
    background: rgba(255, 215, 0, 0.3);
    border-color: #ffd700;
    color: #ffd700;
}

.btn-test {
    background: linear-gradient(135deg, #ffd700 0%, #ff8c00 100%);
    color: white;
    margin-top: 10px;
}

.btn-test:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 215, 0, 0.4);
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 15px;
    margin-bottom: 40px;
}

.calendar-day {
    aspect-ratio: 1;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    position: relative;
    overflow: hidden;
}

.calendar-day::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, #c92a2a 0%, #e03131 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.calendar-day:hover::before {
    opacity: 0.1;
}

.calendar-day:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

.calendar-day.locked {
    background: rgba(200, 200, 200, 0.5);
    cursor: not-allowed;
    opacity: 0.6;
}

.calendar-day.locked::before {
    display: none;
}

.calendar-day.opened {
    background: #549458;
    color: white;
    opacity: 0.9;
}

.calendar-day.opened::before {
    display: none;
}

.calendar-day.opened-but-not-solved {
    background: #ffd4a3;
    color: #333;
    opacity: 0.9;
}

.calendar-day.opened-but-not-solved::before {
    display: none;
}

.day-number {
    font-size: 2em;
    font-weight: bold;
    z-index: 1;
    position: relative;
}

.day-status {
    font-size: 0.8em;
    margin-top: 5px;
    z-index: 1;
    position: relative;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    animation: fadeIn 0.3s ease;
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.modal-content {
    background: white;
    border-radius: 20px;
    padding: 30px;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    animation: slideUp 0.3s ease;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

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

.close {
    position: absolute;
    right: 20px;
    top: 20px;
    font-size: 2em;
    font-weight: bold;
    color: #aaa;
    cursor: pointer;
    transition: color 0.3s ease;
}

.close:hover {
    color: #333;
}

.modal-header {
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #eee;
}

.modal-header h2 {
    color: #c92a2a;
    font-size: 2em;
}

.modal-body {
    margin-top: 20px;
}

.scanner-container {
    width: 100%;
    max-width: 400px;
    margin: 20px auto;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

#video {
    width: 100%;
    display: block;
}

.code-input {
    width: 100%;
    padding: 15px;
    font-size: 1.1em;
    border: 2px solid #ddd;
    border-radius: 10px;
    margin: 15px 0;
    transition: border-color 0.3s ease;
}

.code-input:focus {
    outline: none;
    border-color: #c92a2a;
}

.scan-hint {
    text-align: center;
    color: #666;
    margin: 15px 0;
    font-style: italic;
}

.enigme-section {
    margin-top: 30px;
}

.enigme-content {
    background: linear-gradient(135deg, #c92a2a 0%, #e03131 100%);
    color: white;
    padding: 25px;
    border-radius: 15px;
    font-size: 1.1em;
    line-height: 1.6;
    margin: 20px 0;
    box-shadow: 0 4px 15px rgba(201, 42, 42, 0.25);
}

.reponse-section {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 2px solid #eee;
}

.reponse-section h4 {
    color: #c92a2a;
    margin-bottom: 15px;
    font-size: 1.2em;
}

.reponse-input {
    width: 100%;
    padding: 15px;
    font-size: 1.1em;
    border: 2px solid #ddd;
    border-radius: 10px;
    margin-bottom: 15px;
    transition: border-color 0.3s ease;
}

.reponse-input:focus {
    outline: none;
    border-color: #c92a2a;
}

.result-animation {
    margin: 30px 0;
    text-align: center;
}

.animation-content {
    padding: 30px;
    border-radius: 15px;
    font-size: 1.3em;
    animation: popIn 0.5s ease;
}

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

.animation-content.success {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(17, 153, 142, 0.4);
}

.animation-content.failure {
    background: linear-gradient(135deg, #eb3349 0%, #f45c43 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(235, 51, 73, 0.4);
}

.success-icon, .failure-icon {
    font-size: 4em;
    margin-bottom: 15px;
    animation: bounce 0.6s ease;
}

@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-20px);
    }
}

.success-text, .failure-text {
    font-weight: bold;
    margin-top: 10px;
}

.echec-message {
    margin-top: 30px;
    padding: 25px;
    background: #fff3cd;
    border: 2px solid #ffc107;
    border-radius: 15px;
    text-align: center;
    animation: shake 0.5s ease;
}

.souvenir-section {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 2px solid #eee;
}

.souvenir-section h3 {
    color: #c92a2a;
    margin-bottom: 15px;
    font-size: 1.3em;
    text-align: center;
}

.souvenir-content {
    background: linear-gradient(135deg, #c9c3ff 0%, #47ffd5 100%);
    color: #333;
    padding: 25px;
    border-radius: 15px;
    font-size: 1.1em;
    line-height: 1.8;
    margin: 20px 0;
    box-shadow: 0 4px 15px rgb(0 173 255 / 30%);
    text-align: center;
    font-weight: 500;
    animation: fadeInUp 0.5s ease;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }
    25% {
        transform: translateX(-10px);
    }
    75% {
        transform: translateX(10px);
    }
}

.echec-text {
    color: #856404;
    font-size: 1.2em;
    font-weight: bold;
    margin-bottom: 10px;
}

.hint-text {
    color: #856404;
    font-size: 1em;
    margin-bottom: 20px;
    font-style: italic;
}

.btn {
    padding: 12px 30px;
    font-size: 1em;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: bold;
    margin: 10px 5px;
}

.btn-primary {
    background: linear-gradient(135deg, #c92a2a 0%, #e03131 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(201, 42, 42, 0.3);
}

.btn-secondary {
    background: #ccc;
    color: #333;
}

.btn-secondary:hover {
    background: #aaa;
}

.instructions {
    background: rgba(255, 255, 255, 0.95);
    padding: 30px;
    border-radius: 20px;
    margin-top: 40px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.instructions h3 {
    color: #c92a2a;
    margin-bottom: 15px;
    font-size: 1.5em;
}

.instructions ol {
    margin-left: 20px;
    line-height: 2;
}

.instructions li {
    margin-bottom: 10px;
    font-size: 1.1em;
}

/* Banner d'installation PWA */
.install-banner {
    background: linear-gradient(135deg, #ffd700 0%, #ff8c00 100%);
    color: #333;
    padding: 15px 20px;
    margin-bottom: 20px;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    animation: slideDown 0.5s ease;
}

@keyframes slideDown {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.install-banner-content {
    display: flex;
    align-items: center;
    gap: 15px;
    max-width: 1200px;
    margin: 0 auto;
}

.install-icon {
    font-size: 2em;
    flex-shrink: 0;
}

.install-text {
    flex: 1;
}

.install-text strong {
    display: block;
    font-size: 1.1em;
    margin-bottom: 5px;
}

.install-text p {
    font-size: 0.9em;
    margin: 0;
    opacity: 0.9;
}

.btn-install {
    padding: 10px 20px;
    background: #c92a2a;
    color: white;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.btn-install:hover {
    background: #a02020;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(201, 42, 42, 0.3);
}

.btn-dismiss {
    background: transparent;
    border: none;
    font-size: 1.5em;
    color: #333;
    cursor: pointer;
    padding: 0 10px;
    line-height: 1;
    transition: color 0.3s ease;
}

.btn-dismiss:hover {
    color: #000;
}

.btn-install-header {
    margin-top: 15px;
    margin-left: 10px;
    padding: 10px 20px;
    font-size: 0.9em;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 2px solid white;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: bold;
}

.btn-install-header:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

/* Responsive */
@media (max-width: 768px) {
    header h1 {
        font-size: 2em;
    }
    
    .calendar-grid {
        grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
        gap: 10px;
    }
    
    .day-number {
        font-size: 1.5em;
    }
    
    .modal-content {
        padding: 20px;
    }
    
    .install-banner-content {
        flex-wrap: wrap;
        gap: 10px;
    }
    
    .install-text {
        flex-basis: 100%;
    }
    
    .btn-install {
        flex: 1;
    }
}

