/* --- FLIP CARD CONTAINER --- */
.riddle-container {
    width: 100%;
    margin: 30px 0;
}

/* --- CARD STYLES --- */
.riddle-card {
    background-color: transparent;
    width: 100%;
    min-height: 350px;
    perspective: 1000px;
    cursor: pointer;
    margin-bottom: 20px;
}

.riddle-card-inner {
    position: relative;
    width: 100%;
    min-height: 350px;
    text-align: center;
    transition: transform 0.6s;
    transform-style: preserve-3d;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    border-radius: 12px;
}

.riddle-card.flipped .riddle-card-inner {
    transform: rotateY(180deg);
}

.riddle-card-front,
.riddle-card-back {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    min-height: 100%;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 40px;
    box-sizing: border-box;
}

/* FRONT: Cream/White with Orange Accents */
.riddle-card-front {
    background-color: #FAFAFA;
    background-image:
        radial-gradient(circle at top right, #FEF1E4 0%, transparent 25%),
        radial-gradient(circle at bottom left, #FEF1E4 0%, transparent 25%);
    border: 1px solid #E5D7D1;
}

.riddle-card-front h1 {
    font-size: 28px;
    color: #000;
    margin-bottom: 15px;
    line-height: 1.3;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.click-instruction {
    font-size: 13px;
    color: #888;
    margin-top: 15px;
    letter-spacing: 1px;
    text-transform: uppercase;
    font-weight: 600;
}

/* BACK: Orange Background, White Text */
.riddle-card-back {
    background-color: #FF6210;
    /* Main Orange */
    color: #ffffff;
    transform: rotateY(180deg);
}

.riddle-card-back h2 {
    font-size: 18px;
    margin-bottom: 15px;
    color: rgba(255, 255, 255, 0.8);
    text-transform: uppercase;
    letter-spacing: 2px;
}

.riddle-card-back .answer-text {
    font-size: 36px;
    font-weight: 800;
    color: #ffffff;
    line-height: 1.2;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* --- MOBILE RESPONSIVE --- */
@media (max-width: 768px) {
    .riddle-card {
        min-height: 280px;
    }

    .riddle-card-inner {
        min-height: 280px;
    }

    .riddle-card-front,
    .riddle-card-back {
        padding: 24px 18px;
    }

    .riddle-card-front h1 {
        font-size: 20px;
        margin-bottom: 10px;
        line-height: 1.4;
    }

    .click-instruction {
        font-size: 11px;
        margin-top: 10px;
    }

    .riddle-card-back .answer-text {
        font-size: 28px;
    }

    .riddle-card-back h2 {
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .riddle-card-front h1 {
        font-size: 17px;
    }

    .riddle-card-front,
    .riddle-card-back {
        padding: 20px 14px;
    }

    .riddle-card-back .answer-text {
        font-size: 24px;
    }
}

/* --- EXPLANATION (Subtler) --- */
.riddle-explanation {
    border-top: 1px solid #eee;
    margin-top: 20px;
    padding-top: 20px;
}

.toggle-btn {
    background: none;
    border: none;
    color: #666;
    font-family: inherit;
    /* Inherit site font */
    font-size: 16px;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: color 0.3s;
}

.toggle-btn:hover {
    color: #FF6210;
}

.arrow {
    transition: transform 0.3s;
    font-size: 12px;
}

.toggle-btn.active .arrow {
    transform: rotate(180deg);
}

.explanation-content {
    display: none;
    margin-top: 20px;
    background: #F9F9F9;
    padding: 25px;
    border-left: 4px solid #FF6210;
    border-radius: 4px;
}

.explanation-content.visible {
    display: block;
    animation: fadeIn 0.5s;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.explanation-content h2 {
    font-size: 20px;
    color: #444;
    margin-bottom: 10px;
}

.explanation-content p {
    color: #555;
    font-size: 17px;
}