@import url('https://fonts.googleapis.com/css2?family=Comfortaa:wght@300;400;600;700&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Comfortaa', cursive;
    background: linear-gradient(135deg, #00d4aa, #00a8cc, #6a4c93);
    min-height: 100vh;
    color: #333;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.timer {
    background: linear-gradient(45deg, #ff6b6b, #feca57);
    color: white;
    text-align: center;
    padding: 15px;
    border-radius: 20px;
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 20px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.2);
    border: 3px solid #fff;
    animation: timerPulse 2s ease-in-out infinite;
}

@keyframes timerPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.02); }
}

.main-content {
    display: flex;
    gap: 30px;
    flex: 1;
}

.game-area {
    flex: 2;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 25px;
    padding: 40px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.1);
    border: 4px solid #fff;
}

.profile-card {
    flex: 1;
    background: linear-gradient(145deg, #a8edea, #fed6e3);
    border-radius: 25px;
    padding: 30px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.1);
    border: 4px solid #fff;
    height: fit-content;
}

.page-title {
    font-size: 36px;
    font-weight: 700;
    color: #6a4c93;
    margin-bottom: 20px;
    text-align: center;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.1);
}

.description {
    font-size: 18px;
    line-height: 1.6;
    margin-bottom: 30px;
    color: #555;
}

.game-image {
    width: 100%;
    max-width: 500px;
    height: 500px;
    object-fit: cover;
    border-radius: 20px;
    margin: 20px auto;
    display: block;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    border: 3px solid #fff;
}

.start-button {
    background: linear-gradient(45deg, #00d4aa, #00a8cc);
    color: white;
    border: none;
    padding: 20px 40px;
    font-size: 24px;
    font-weight: 700;
    border-radius: 50px;
    cursor: pointer;
    display: block;
    margin: 30px auto;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    border: 3px solid #fff;
    transition: all 0.3s ease;
    font-family: inherit;
}

.start-button:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0,0,0,0.3);
}

.puzzle-input {
    width: 100%;
    padding: 15px;
    font-size: 20px;
    border: 3px solid #6a4c93;
    border-radius: 15px;
    margin: 20px 0;
    text-align: center;
    font-family: inherit;
    letter-spacing: 3px;
    text-transform: uppercase;
    transition: all 0.3s ease;
}

.puzzle-input:focus {
    outline: none;
    border-color: #00a8cc;
    box-shadow: 0 0 20px rgba(0, 168, 204, 0.3);
}

.submit-button {
    background: linear-gradient(45deg, #feca57, #ff9ff3);
    color: white;
    border: none;
    padding: 15px 30px;
    font-size: 18px;
    font-weight: 600;
    border-radius: 25px;
    cursor: pointer;
    display: block;
    margin: 0 auto;
    box-shadow: 0 8px 25px rgba(0,0,0,0.2);
    border: 2px solid #fff;
    transition: all 0.3s ease;
    font-family: inherit;
}

.submit-button:hover:not(:disabled) {
    transform: translateY(-3px);
    box-shadow: 0 12px 35px rgba(0,0,0,0.3);
}

.submit-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.profile-name {
    font-size: 28px;
    font-weight: 700;
    color: #6a4c93;
    text-align: center;
    margin-bottom: 25px;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.1);
}

.traits-section {
    margin-top: 20px;
}

.traits-title {
    font-size: 20px;
    font-weight: 600;
    color: #333;
    margin-bottom: 15px;
    text-align: center;
}

.trait {
    background: rgba(255, 255, 255, 0.8);
    padding: 12px 15px;
    margin: 8px 0;
    border-radius: 20px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.trait:hover {
    background: rgba(255, 255, 255, 1);
    border-color: #6a4c93;
    transform: translateY(-2px);
}

.trait-header {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
}

.trait-icon {
    font-size: 20px;
}

.trait-details {
    margin-top: 8px;
    font-size: 14px;
    color: #666;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.trait-description {
    margin-bottom: 5px;
    line-height: 1.4;
}

.trait-aspiration {
    font-weight: 600;
    color: #6a4c93;
}

.trait.expanded .trait-details {
    display: block;
    opacity: 1;
}

.success-popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: linear-gradient(45deg, #00d4aa, #00a8cc);
    color: white;
    padding: 30px;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    z-index: 1000;
    text-align: center;
    font-size: 18px;
    font-weight: 600;
    border: 3px solid #fff;
    max-width: 400px;
    animation: popupAppear 0.5s ease;
}

@keyframes popupAppear {
    from {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.8);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 999;
    animation: overlayFade 0.3s ease;
}

@keyframes overlayFade {
    from { opacity: 0; }
    to { opacity: 1; }
}

.error-message {
    background: linear-gradient(45deg, #ff6b6b, #feca57);
    color: white;
    padding: 15px;
    border-radius: 15px;
    margin: 15px 0;
    text-align: center;
    font-weight: 600;
    border: 2px solid #fff;
    animation: shake 0.5s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

.success-message {
    background: linear-gradient(45deg, #00d4aa, #00a8cc);
    color: white;
    padding: 15px;
    border-radius: 15px;
    margin: 15px 0;
    text-align: center;
    font-weight: 600;
    border: 2px solid #fff;
}

.close-popup {
    background: rgba(255,255,255,0.2);
    color: white;
    border: 2px solid white;
    padding: 10px 20px;
    border-radius: 15px;
    cursor: pointer;
    margin-top: 15px;
    font-family: inherit;
    font-weight: 600;
    transition: all 0.3s ease;
}

.close-popup:hover {
    background: rgba(255,255,255,0.3);
    transform: translateY(-2px);
}

.no-traits {
    text-align: center;
    color: #666;
    font-style: italic;
    padding: 20px;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 15px;
    border: 2px dashed #ccc;
}

.anagram-hint {
    background: linear-gradient(45deg, #a8edea, #fed6e3);
    padding: 15px;
    border-radius: 15px;
    margin: 20px 0;
    text-align: center;
    font-weight: 600;
    color: #6a4c93;
    border: 2px solid #fff;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

/* Navigation */
.navigation {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 30px;
}

.nav-button {
    background: linear-gradient(45deg, #6a4c93, #a8edea);
    color: white;
    text-decoration: none;
    padding: 12px 24px;
    border-radius: 20px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    border: 2px solid #fff;
}

.nav-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.2);
}

/* Styles pour le puzzle des chiffres */
.digits-container {
    text-align: center;
    margin: 30px 0;
}

.digits-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    max-width: 500px;
    margin: 0 auto 30px;
}

.digit-card {
    width: 100px;
    height: 100px;
    perspective: 1000px;
    cursor: pointer;
    margin: 0 auto;
    transition: all 0.3s ease;
}

.digit-card:hover:not(.flipped) {
    transform: scale(1.05);
}

.card-front, .card-back {
    width: 100%;
    height: 100%;
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    border: 3px solid #fff;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    transition: all 0.6s ease;
}

.card-front {
    background: linear-gradient(45deg, #6a4c93, #a8edea);
    color: white;
    position: relative;
}

.card-back {
    background: linear-gradient(45deg, #00d4aa, #feca57);
    color: white;
    position: absolute;
    top: 0;
    left: 0;
}

.digit-number {
    font-size: 28px;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
}

.digit-letter {
    font-size: 32px;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
}

.letters-title {
    font-size: 18px;
    color: #6a4c93;
    font-weight: 600;
    margin-bottom: 15px;
}

.letters-display {
    font-size: 36px;
    font-weight: bold;
    color: #00a8cc;
    letter-spacing: 8px;
    min-height: 50px;
    display: flex;
    justify-content: center;
    align-items: center;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 15px;
    padding: 20px;
    margin: 0 auto;
    max-width: 600px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.puzzle-input-section {
    text-align: center;
    margin: 30px 0;
}

.puzzle-instruction {
    background: linear-gradient(45deg, #fed6e3, #a8edea);
    padding: 20px;
    border-radius: 15px;
    margin-bottom: 20px;
    font-weight: 600;
    color: #6a4c93;
    border: 2px solid #fff;
}

.sequence-input {
    width: 300px;
    padding: 15px;
    font-size: 24px;
    text-align: center;
    border: 3px solid #6a4c93;
    border-radius: 15px;
    margin: 20px 0;
    letter-spacing: 8px;
    font-family: inherit;
    transition: all 0.3s ease;
}

.sequence-input:focus {
    outline: none;
    border-color: #00a8cc;
    box-shadow: 0 0 20px rgba(0, 168, 204, 0.3);
}

.input-help {
    font-size: 14px;
    color: #666;
    margin-top: 10px;
    font-style: italic;
}

.puzzle-help {
    background: linear-gradient(45deg, #fed6e3, #a8edea);
    padding: 15px;
    border-radius: 15px;
    margin: 20px 0;
    text-align: center;
    font-weight: 600;
    color: #6a4c93;
    border: 2px solid #fff;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

/* Achievements */
.achievement-summary {
    background: linear-gradient(45deg, #a8edea, #fed6e3);
    padding: 30px;
    border-radius: 20px;
    margin: 30px 0;
    border: 3px solid #fff;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.achievement-summary h3 {
    text-align: center;
    color: #6a4c93;
    margin-bottom: 25px;
    font-size: 24px;
}

.achievements-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}

.achievement-item {
    background: rgba(255, 255, 255, 0.8);
    padding: 20px;
    border-radius: 15px;
    display: flex;
    align-items: center;
    gap: 20px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}

.achievement-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.2);
}

.achievement-icon {
    font-size: 48px;
    flex-shrink: 0;
}

.achievement-text {
    flex: 1;
}

.achievement-text strong {
    color: #6a4c93;
    font-size: 18px;
}

.coming-soon-info {
    background: rgba(255, 255, 255, 0.9);
    padding: 25px;
    border-radius: 20px;
    margin: 30px 0;
    border: 3px solid #fff;
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
}

.coming-soon-info h3 {
    color: #6a4c93;
    margin-bottom: 20px;
    text-align: center;
    font-size: 22px;
}

.feature-list {
    list-style: none;
    padding: 0;
}

.feature-list li {
    padding: 10px 0;
    font-size: 16px;
    color: #555;
    border-bottom: 1px solid rgba(106, 76, 147, 0.1);
}

.feature-list li:last-child {
    border-bottom: none;
}

/* Animations */
@keyframes flipIn {
    from { 
        transform: rotateY(180deg) scale(0.8); 
        opacity: 0.5;
    }
    to { 
        transform: rotateY(0deg) scale(1); 
        opacity: 1;
    }
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

/* Responsive Design */
@media (max-width: 768px) {
    .main-content {
        flex-direction: column;
    }
    
    .game-area {
        padding: 20px;
    }
    
    .profile-card {
        padding: 20px;
    }
    
    .page-title {
        font-size: 28px;
    }
    
    .description {
        font-size: 16px;
    }
    
    .digits-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
        max-width: 300px;
    }
    
    .digit-card {
        width: 80px;
        height: 80px;
    }
    
    .sequence-input {
        width: 250px;
        font-size: 18px;
    }
    
    .letters-display {
        font-size: 24px;
        letter-spacing: 4px;
    }
    
    .achievement-item {
        flex-direction: column;
        text-align: center;
    }
    
    .navigation {
        flex-direction: column;
        align-items: center;
    }
}

/* Styles supplémentaires pour le puzzle 3 - Mot croisé */

.crossword-container {
    display: flex;
    gap: 30px;
    margin: 30px 0;
    align-items: flex-start;
}

.crossword-grid {
    display: grid;
    grid-template-columns: repeat(12, 30px);
    grid-template-rows: repeat(12, 30px);
    gap: 1px;
    padding: 15px;
    border-radius: 15px;
    background: linear-gradient(45deg, #6a4c93, #a8edea);
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    border: 3px solid #fff;
}

.crossword-cell {
    width: 30px;
    height: 30px;
    background: white;
    border: 1px solid #ddd;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
    text-transform: uppercase;
    position: relative;
    border-radius: 3px;
    transition: all 0.2s ease;
}

.crossword-cell.black {
    background: #333;
    border-color: #333;
}

.crossword-cell.numbered::before {
    content: attr(data-number);
    position: absolute;
    top: 1px;
    left: 2px;
    font-size: 8px;
    color: #666;
    font-weight: bold;
    z-index: 1;
}

.crossword-cell input {
    width: 100%;
    height: 100%;
    border: none;
    text-align: center;
    font-size: 12px;
    font-weight: bold;
    text-transform: uppercase;
    background: transparent;
    color: #333;
    padding: 0;
    margin: 0;
}

.crossword-cell input:focus {
    background: linear-gradient(45deg, #ffffcc, #fff9e6);
    outline: 2px solid #00a8cc;
    border-radius: 3px;
    box-shadow: 0 0 10px rgba(0, 168, 204, 0.3);
}

.crossword-cell:hover:not(.black) {
    background: #f8f9fa;
    transform: scale(1.05);
}

.clues-container {
    flex: 1;
    background: rgba(255, 255, 255, 0.95);
    padding: 25px;
    border-radius: 20px;
    border: 3px solid #fff;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    max-height: 500px;
    overflow-y: auto;
}

.clues-section {
    margin-bottom: 25px;
}

.clues-title {
    font-weight: 700;
    color: #6a4c93;
    margin-bottom: 15px;
    font-size: 18px;
    text-align: center;
    background: linear-gradient(45deg, #fed6e3, #a8edea);
    padding: 10px;
    border-radius: 10px;
    border: 2px solid #fff;
}

.clue {
    margin-bottom: 12px;
    font-size: 14px;
    line-height: 1.4;
    padding: 8px 12px;
    background: rgba(168, 237, 234, 0.1);
    border-radius: 8px;
    transition: all 0.2s ease;
}

.clue:hover {
    background: rgba(168, 237, 234, 0.2);
    transform: translateX(5px);
}

.clue-number {
    font-weight: bold;
    color: #00a8cc;
    background: #fff;
    padding: 2px 6px;
    border-radius: 10px;
    margin-right: 8px;
    font-size: 12px;
}

.points-section {
    margin-top: 40px;
    text-align: center;
    background: linear-gradient(45deg, #fed6e3, #a8edea);
    padding: 25px;
    border-radius: 20px;
    border: 3px solid #fff;
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
}

.points-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 15px;
    max-width: 500px;
    margin: 25px auto;
}

.points-dropdown {
    padding: 12px 8px;
    border: 3px solid #6a4c93;
    border-radius: 12px;
    font-size: 14px;
    font-weight: bold;
    text-align: center;
    background: white;
    transition: all 0.3s ease;
    cursor: pointer;
}

.points-dropdown:focus {
    outline: none;
    border-color: #00a8cc;
    box-shadow: 0 0 15px rgba(0, 168, 204, 0.3);
    transform: scale(1.05);
}

.points-dropdown:hover {
    border-color: #00a8cc;
    transform: translateY(-2px);
}

.crossword-help {
    background: linear-gradient(45deg, #fed6e3, #a8edea);
    padding: 20px;
    border-radius: 20px;
    margin: 25px 0;
    text-align: center;
    font-weight: 600;
    color: #6a4c93;
    border: 3px solid #fff;
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
    animation: helpPulse 3s ease-in-out infinite;
}

@keyframes helpPulse {
    0%, 100% { 
        transform: scale(1); 
        box-shadow: 0 8px 25px rgba(0,0,0,0.1);
    }
    50% { 
        transform: scale(1.02); 
        box-shadow: 0 12px 35px rgba(0,0,0,0.15);
    }
}

.puzzle-instruction {
    background: linear-gradient(45deg, #6a4c93, #a8edea);
    color: white;
    padding: 20px;
    border-radius: 15px;
    margin-bottom: 25px;
    font-weight: 600;
    border: 3px solid #fff;
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
}

.input-help {
    margin-top: 20px;
    font-size: 16px;
    color: #6a4c93;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.8);
    padding: 15px;
    border-radius: 12px;
    border: 2px solid #fff;
}

#current-sequence {
    font-family: 'Courier New', monospace;
    font-size: 18px;
    font-weight: bold;
    color: #00a8cc;
    letter-spacing: 2px;
    background: white;
    padding: 8px 15px;
    border-radius: 8px;
    border: 2px solid #00a8cc;
    display: inline-block;
    margin-left: 10px;
}

/* Animations d'apparition pour les éléments du mot croisé */
.crossword-cell {
    animation: cellAppear 0.5s ease-out;
}

@keyframes cellAppear {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.clue {
    animation: clueSlide 0.3s ease-out;
}

@keyframes clueSlide {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Responsive design pour le mot croisé */
@media (max-width: 768px) {
    .crossword-container {
        flex-direction: column;
        gap: 20px;
    }
    
    .crossword-grid {
        grid-template-columns: repeat(12, 25px);
        grid-template-rows: repeat(12, 25px);
        padding: 10px;
        max-width: 100%;
        margin: 0 auto;
    }
    
    .crossword-cell {
        width: 25px;
        height: 25px;
    }
    
    .crossword-cell input {
        font-size: 10px;
    }
    
    .clues-container {
        max-height: none;
        padding: 20px;
    }
    
    .points-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
        max-width: 300px;
    }
    
    .points-dropdown {
        padding: 10px 6px;
        font-size: 12px;
    }
    
    .crossword-help {
        padding: 15px;
        font-size: 14px;
    }
}